diff --git a/ui/src/main/java/ucar/util/prefs/XMLStore.java b/ui/src/main/java/ucar/util/prefs/XMLStore.java
index <HASH>..<HASH> 100644
--- a/ui/src/main/java/ucar/util/prefs/XMLStore.java
+++ b/ui/src/main/java/ucar/util/prefs/XMLStore.java
@@ -593,8 +593,9 @@ public class XMLStore {
 
     // success - rename files
     Path xmlBackup = Paths.get(prefsFile.getAbsolutePath() + ".bak");
-    Files.move(prefsFile.toPath(), xmlBackup,
-            StandardCopyOption.REPLACE_EXISTING);
+    Path prefsPath = prefsFile.toPath();
+    if (Files.exists(prefsPath))
+        Files.move(prefsPath, xmlBackup, StandardCopyOption.REPLACE_EXISTING);
     Files.move(prefTemp.toPath(), prefsFile.toPath(),
             StandardCopyOption.REPLACE_EXISTING);
   }
UI: Fix preferences--only try to backup prefs if they exist.

This was introduced in a Coverity fix and should have been noticed by
seeing the failing tests.