Merge branch 'develop' into spike/JAL-4047/JAL-4048_columns_in_sequenceID
[jalview.git] / src / jalview / io / BackupFiles.java
index 14c1260..c67c307 100644 (file)
@@ -232,6 +232,12 @@ public class BackupFiles
   public BackupFiles(File file)
   {
     classInit();
+    if (file.getParentFile() == null)
+    {
+      // filename probably in pwd represented with no parent -- fix it before
+      // it's a problem
+      file = file.getAbsoluteFile();
+    }
     this.file = file;
 
     // add this file from the save in progress stack
@@ -252,7 +258,7 @@ public class BackupFiles
       if (file != null)
       {
         String tempfilename = file.getName();
-        File tempdir = file.getParentFile();
+        File tempdir = file.getAbsoluteFile().getParentFile();
         tempdir.mkdirs();
         Console.trace(
                 "BACKUPFILES [file!=null] attempting to create temp file for "
@@ -283,7 +289,7 @@ public class BackupFiles
     this.setTempFile(temp);
   }
 
-  public static void classInit()
+  private static void classInit()
   {
     Console.initLogger();
     Console.trace("BACKUPFILES classInit");