Skip to content

Commit

Permalink
Merge pull request #1005 from OpenBCI/development
Browse files Browse the repository at this point in the history
Hot Fix NullPointer error related to missing folder and GUI-wide settings file
  • Loading branch information
retiutut authored Oct 2, 2021
2 parents 8db90eb + c20658a commit 4ab8cf7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions OpenBCI_GUI/GuiSettings.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion OpenBCI_GUI/Info.plist.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<key>CFBundleShortVersionString</key>
<string>5</string>
<key>CFBundleVersion</key>
<string>5.0.7</string>
<string>5.0.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion OpenBCI_GUI/OpenBCI_GUI.pde
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 4ab8cf7

Please sign in to comment.