don't save references to null contents
authorpeter <peter@jetbrains.com>
Tue, 24 Jan 2012 18:09:04 +0000 (19:09 +0100)
committerpeter <peter@jetbrains.com>
Tue, 24 Jan 2012 18:09:04 +0000 (19:09 +0100)
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/LastUnchangedContentTracker.java

index a672b25313fd0375f9a7ed12f3e0b9a294676796..546fbfbc28d330fee11871d8a806cfd8d7bbc45b 100644 (file)
@@ -70,7 +70,11 @@ public class LastUnchangedContentTracker {
   }
 
   private static void saveContentReference(VirtualFile file, int contentId) {
-    //LOG.assertTrue(contentId > 0, contentId);
+    if (contentId == 0) {
+      return; // content not loaded yet, nothing to save
+    }
+
+    LOG.assertTrue(contentId > 0, contentId);
     if (ChangeListManagerImpl.DEBUG) {
       System.out.println("LastUnchangedContentTracker.saveCurrentContent");
       try {