From e5d74688220a63c843104d58cfcfa1b7b3dffa01 Mon Sep 17 00:00:00 2001 From: Richard Waltman Date: Fri, 1 Oct 2021 15:22:05 -0500 Subject: [PATCH 1/2] Hot Fix NullPointer error related to missing folder and GUI-wide settings file #1003 #1004 --- CHANGELOG.md | 5 +++++ OpenBCI_GUI/GuiSettings.pde | 15 +++++++++++++++ 2 files changed, 20 insertions(+) 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); From c20658ae9f1cc15cfa3a49c95da65654c5bb0c30 Mon Sep 17 00:00:00 2001 From: Richard Waltman Date: Fri, 1 Oct 2021 20:04:50 -0500 Subject: [PATCH 2/2] Bump version to 5.0.8 --- OpenBCI_GUI/Info.plist.tmpl | 2 +- OpenBCI_GUI/OpenBCI_GUI.pde | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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";