diff --git a/CHANGELOG.md b/CHANGELOG.md index 4336d8ffd..12fbc6cb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v5.0.8 + +### Bug Fixes +* Hot Fix NullPointer error related to missing folder and GUI-wide settings file #1003 #1004 + # v5.0.7 ### Improvements diff --git a/OpenBCI_GUI/GuiSettings.pde b/OpenBCI_GUI/GuiSettings.pde index 8215c34d6..00f79a4f8 100644 --- a/OpenBCI_GUI/GuiSettings.pde +++ b/OpenBCI_GUI/GuiSettings.pde @@ -86,6 +86,21 @@ class GuiSettings { public boolean saveToFile() { String json = getJson(); + + try { + final File file = new File(filename); + final File parent_directory = file.getParentFile(); + + if (null != parent_directory) + { + parent_directory.mkdirs(); + } + } catch (Exception e) { + e.printStackTrace(); + outputWarn("OpenBCI_GUI::Settings: Error creating /Documents/OpenBCI_GUI/Settings/ folder. Please make an issue on GitHub."); + return false; + } + try { FileWriter writer = new FileWriter(filename); writer.write(json); diff --git a/OpenBCI_GUI/Info.plist.tmpl b/OpenBCI_GUI/Info.plist.tmpl index 936cc6a2d..1d4735c2e 100644 --- a/OpenBCI_GUI/Info.plist.tmpl +++ b/OpenBCI_GUI/Info.plist.tmpl @@ -23,7 +23,7 @@ CFBundleShortVersionString 5 CFBundleVersion - 5.0.7 + 5.0.8 CFBundleSignature ???? NSHumanReadableCopyright diff --git a/OpenBCI_GUI/OpenBCI_GUI.pde b/OpenBCI_GUI/OpenBCI_GUI.pde index 662590055..8c9436cf8 100644 --- a/OpenBCI_GUI/OpenBCI_GUI.pde +++ b/OpenBCI_GUI/OpenBCI_GUI.pde @@ -60,7 +60,7 @@ import http.requests.*; // Global Variables & Instances //------------------------------------------------------------------------ //Used to check GUI version in TopNav.pde and displayed on the splash screen on startup -String localGUIVersionString = "v5.0.7"; +String localGUIVersionString = "v5.0.8"; String localGUIVersionDate = "September 2021"; String guiLatestVersionGithubAPI = "https://api.github.com/repos/OpenBCI/OpenBCI_GUI/releases/latest"; String guiLatestReleaseLocation = "https://github.com/OpenBCI/OpenBCI_GUI/releases/latest";