checked for null in menubar
This commit is contained in:
parent
be748d9138
commit
06397cc6cf
@ -96,12 +96,15 @@ public class MenubarController implements Initializable, Controller {
|
||||
Stage stage = (Stage) menubar.getScene().getWindow();
|
||||
|
||||
File chosenFile = fc.showOpenDialog(stage);
|
||||
if (chosenFile != null) {
|
||||
String correctFormat = chosenFile.getAbsolutePath().replace("\\", "\\\\");
|
||||
|
||||
Model.setActiveFilePath(chosenFile.toPath());
|
||||
this.eventBus.post(new FileSelectedEvent(correctFormat));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles whenever the Open Project button is pressed in the menubar
|
||||
*/
|
||||
@ -112,6 +115,7 @@ public class MenubarController implements Initializable, Controller {
|
||||
Stage stage = (Stage) menubar.getScene().getWindow();
|
||||
|
||||
File chosenDir = dc.showDialog(stage);
|
||||
if (chosenDir != null) {
|
||||
String correctFormat = chosenDir.getAbsolutePath().replace("\\", "\\\\");
|
||||
|
||||
Model.setProjectPath(chosenDir.toPath());
|
||||
@ -119,6 +123,8 @@ public class MenubarController implements Initializable, Controller {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* SAVE FILE */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
Loading…
Reference in New Issue
Block a user