Skip to content

Commit 90cf4f7

Browse files
cynthi8orangecms
authored andcommitted
Fix: viewing datalogger crashes application
Fixes bug where opening the datalogger would crash PSLab. Problem occurs when the user doesn't have a Documents folder in the home location. The PSLab directory fails to be made and the application crashes when accessing this nonexistent directory.
1 parent b185da2 commit 90cf4f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/screen/LoggedData/LoggedData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class LoggedData extends Component {
5252
componentDidMount() {
5353
this.destDir = path.join(os.homedir(), 'Documents', 'PSLab');
5454
if (!fs.existsSync(this.destDir)) {
55-
fs.mkdirSync(this.destDir);
55+
fs.mkdirSync(this.destDir, { recursive: true });
5656
}
5757
this.watcher = chokidar.watch(this.destDir);
5858
this.setState({

0 commit comments

Comments
 (0)