Don’t throw a NullPointerException when no file is selected.
[jSite.git] / src / de / todesbaum / jsite / gui / ProjectFilesPage.java
index d2479d4..a6fa3ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * jSite - ProjectFilesPage.java - Copyright © 2006–2011 David Roden
+ * jSite - ProjectFilesPage.java - Copyright © 2006–2012 David Roden
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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 {