Skip to content

Commit 4ab8cf7

Browse files
authored
Merge pull request #1005 from OpenBCI/development
Hot Fix NullPointer error related to missing folder and GUI-wide settings file
2 parents 8db90eb + c20658a commit 4ab8cf7

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# v5.0.8
2+
3+
### Bug Fixes
4+
* Hot Fix NullPointer error related to missing folder and GUI-wide settings file #1003 #1004
5+
16
# v5.0.7
27

38
### Improvements

OpenBCI_GUI/GuiSettings.pde

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,21 @@ class GuiSettings {
8686

8787
public boolean saveToFile() {
8888
String json = getJson();
89+
90+
try {
91+
final File file = new File(filename);
92+
final File parent_directory = file.getParentFile();
93+
94+
if (null != parent_directory)
95+
{
96+
parent_directory.mkdirs();
97+
}
98+
} catch (Exception e) {
99+
e.printStackTrace();
100+
outputWarn("OpenBCI_GUI::Settings: Error creating /Documents/OpenBCI_GUI/Settings/ folder. Please make an issue on GitHub.");
101+
return false;
102+
}
103+
89104
try {
90105
FileWriter writer = new FileWriter(filename);
91106
writer.write(json);

OpenBCI_GUI/Info.plist.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<key>CFBundleShortVersionString</key>
2424
<string>5</string>
2525
<key>CFBundleVersion</key>
26-
<string>5.0.7</string>
26+
<string>5.0.8</string>
2727
<key>CFBundleSignature</key>
2828
<string>????</string>
2929
<key>NSHumanReadableCopyright</key>

OpenBCI_GUI/OpenBCI_GUI.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import http.requests.*;
6060
// Global Variables & Instances
6161
//------------------------------------------------------------------------
6262
//Used to check GUI version in TopNav.pde and displayed on the splash screen on startup
63-
String localGUIVersionString = "v5.0.7";
63+
String localGUIVersionString = "v5.0.8";
6464
String localGUIVersionDate = "September 2021";
6565
String guiLatestVersionGithubAPI = "https://api.github.com/repos/OpenBCI/OpenBCI_GUI/releases/latest";
6666
String guiLatestReleaseLocation = "https://github.com/OpenBCI/OpenBCI_GUI/releases/latest";

0 commit comments

Comments
 (0)