Sebastian Stenzel 10 лет назад
Родитель
Сommit
9fd271ad7b
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      main/ui/src/main/java/org/cryptomator/ui/MainController.java

+ 5 - 5
main/ui/src/main/java/org/cryptomator/ui/MainController.java

@@ -77,15 +77,15 @@ public class MainController implements Initializable, InitializationListener, Un
 	private void didClickAddDirectory(ActionEvent event) {
 		final DirectoryChooser dirChooser = new DirectoryChooser();
 		final File file = dirChooser.showDialog(stage);
-		addDirectory(file.toPath());
+		if (file != null) {
+			addDirectory(file.toPath());
+		}
 	}
 
 	/**
-	 * adds the given directory or selects it if it is already in the list of
-	 * directories.
+	 * adds the given directory or selects it if it is already in the list of directories.
 	 * 
-	 * @param file
-	 *            non-null, writable, existing directory
+	 * @param file non-null, writable, existing directory
 	 */
 	void addDirectory(final Path file) {
 		if (file != null && Files.isWritable(file)) {