documentor: Fixed editing status on failed write
authorJerome St-Louis <jerome@ecere.com>
Tue, 27 Aug 2013 05:07:16 +0000 (01:07 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 27 Aug 2013 05:07:16 +0000 (01:07 -0400)
documentor/src/Documentor.ec

index ba8fbb8..2cc1a7c 100644 (file)
@@ -2240,10 +2240,10 @@ class HelpView : HTMLView
       GetLastDirectory(location, fileName);
       StripLastDirectory(location, directory);
       archive = ArchiveOpen(archiveFile, { true } );
-      if(archive)
+      // if(archive)
       {
          TempFile f { };
-         ArchiveDir dir = archive.OpenDirectory(directory, null, replace);
+         ArchiveDir dir = archive ? archive.OpenDirectory(directory, null, replace) : null;
          Block block;
          bool empty = true;
          for(block = textBlock.parent.subBlocks.first; block; block = block.next)
@@ -2265,7 +2265,8 @@ class HelpView : HTMLView
             }
          }
          f.Seek(0, start);
-         dir.AddFromFile(fileName, f, null, replace, 0, null, null);
+         if(dir)
+            dir.AddFromFile(fileName, f, null, replace, 0, null, null);
          delete dir;
          delete archive;
          delete f;