]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed NPE when Table does not contain components
authorArtur Signell <artur@vaadin.com>
Wed, 21 Mar 2012 11:54:54 +0000 (13:54 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 21 Mar 2012 13:28:13 +0000 (15:28 +0200)
src/com/vaadin/ui/Table.java

index 32d67939e32044eb390ff3ca3ed2bc354e56ba69..5085f5b5681136799d707145db023edda4e4720f 100644 (file)
@@ -8,6 +8,7 @@ import java.io.Serializable;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -5282,6 +5283,11 @@ public class Table extends AbstractSelect implements Action.Container,
     }
 
     public Iterator<Component> getComponentIterator() {
+        if (visibleComponents == null) {
+            Collection<Component> empty = Collections.emptyList();
+            return empty.iterator();
+        }
+
         return visibleComponents.iterator();
     }