Don’t throw a NullPointerException when no file is selected.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Thu, 22 Mar 2012 20:12:23 +0000 (21:12 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Thu, 22 Mar 2012 20:12:23 +0000 (21:12 +0100)
src/de/todesbaum/jsite/gui/ProjectFilesPage.java

index 8bfc631..a6fa3ab 100644 (file)
@@ -249,6 +249,11 @@ public class ProjectFilesPage extends TWizardPage implements ActionListener, Lis
                        @SuppressWarnings("synthetic-access")
                        private void storeText(DocumentEvent documentEvent) {
                                FileOption fileOption = getSelectedFile();
+                               if (fileOption == null) {
+                                       /* no file selected. */
+                                       System.out.println("yfwdasd");
+                                       return;
+                               }
                                Document document = documentEvent.getDocument();
                                int documentLength = document.getLength();
                                try {