]> source.dussan.org Git - vaadin-framework.git/commitdiff
added null check
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 26 Nov 2007 13:24:02 +0000 (13:24 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 26 Nov 2007 13:24:02 +0000 (13:24 +0000)
svn changeset:2965/svn branch:trunk

src/com/itmill/toolkit/demo/testbench/TestBench.java
src/com/itmill/toolkit/tests/TestBench.java

index 090ee9fe0a781c8b0e44ac702172d9e9d024a652..0021cce8dde6a7e932ab6abe20f94a45e6fbf312 100644 (file)
@@ -139,13 +139,13 @@ public class TestBench extends com.itmill.toolkit.Application implements
         bodyLayout.setCaption(null);
 
         Object o = menu.getValue();
-        if (o instanceof Class) {
+        if (o != null && o instanceof Class) {
             Class c = (Class) o;
             String title = c.getName();
             bodyLayout.setCaption(title);
             bodyLayout.addComponent(createTestable(c));
         } else {
-            // NOP node selected
+            // NOP node selected or deselected tree item
         }
 
     }
index 6de3cc71117e2904c77f89aeae6e3a79b7dceb30..d94548becf25b6b219edb0cd44516885305d99ed 100644 (file)
@@ -144,13 +144,13 @@ public class TestBench extends com.itmill.toolkit.Application implements
         bodyLayout.setCaption(null);
 
         Object o = menu.getValue();
-        if (o instanceof Class) {
+        if (o != null && o instanceof Class) {
             Class c = (Class) o;
             String title = c.getName();
             bodyLayout.setCaption(title);
             bodyLayout.addComponent(createTestable(c));
         } else {
-            // NOP node selected
+            // NOP node selected or deselected tree item
         }
     }