]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed obvious NPE in file upload
authorArtur Signell <artur.signell@itmill.com>
Thu, 25 Jun 2009 14:35:58 +0000 (14:35 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 25 Jun 2009 14:35:58 +0000 (14:35 +0000)
svn changeset:8243/svn branch:6.0

src/com/vaadin/terminal/gwt/server/CommunicationManager.java

index 6c74f4d4dbf584e4e55b7c7fe76007396eb32b91..dc83e26e9bda36420d711e6925690129b64dab02 100644 (file)
@@ -166,14 +166,14 @@ public class CommunicationManager implements Paintable.RepaintRequestListener,
                     final String pid = name.split("_")[0];
                     final Upload uploadComponent = (Upload) idPaintableMap
                             .get(pid);
-                    if (uploadComponent.isReadOnly()) {
-                        throw new FileUploadException(
-                                "Warning: ignored file upload because upload component is set as read-only");
-                    }
                     if (uploadComponent == null) {
                         throw new FileUploadException(
                                 "Upload component not found");
                     }
+                    if (uploadComponent.isReadOnly()) {
+                        throw new FileUploadException(
+                                "Warning: ignored file upload because upload component is set as read-only");
+                    }
                     synchronized (application) {
                         // put upload component into receiving state
                         uploadComponent.startUpload();