Bug 582308 Add description information to snapshot history or details

Avoid NPE.
Display notes if only baseline has notes.

Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=582308
Change-Id: I2038a72a69642acad5a8727b3590c48468e4c1b3
diff --git a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/views/SnapshotOutlinePage.java b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/views/SnapshotOutlinePage.java
index 5c401e8..88c7ef1 100644
--- a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/views/SnapshotOutlinePage.java
+++ b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/views/SnapshotOutlinePage.java
@@ -100,6 +100,8 @@
         @Override

         protected IPath getSnapshotPath()

         {

+            if (snapshotInput == null)

+                return null;

             return this.snapshotInput.getPath();

         }

 

@@ -381,7 +383,7 @@
             }

             String note = getNotes(info);

             String noteb = getNotes(bInfo);

-            if (note != null)

+            if (note != null || noteb != null)

                 category.addChild(new Label(Messages.notes, note, noteb));

 

             category = new Category(Messages.statistic_info);