File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
arduino-core/src/processing/app Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -351,13 +351,22 @@ public void saveAs(File newFolder) throws IOException {
351351 file .saveAs (new File (newFolder , file .getFileName ()));
352352 }
353353
354- folder = newFolder ;
355354
356355 // Copy the data folder (this may take a while.. add progress bar?)
357356 if (getDataFolder ().exists ()) {
358357 File newDataFolder = new File (newFolder , "data" );
358+ // Check if data folder exits, if not try to create the data folder
359+ if (!newDataFolder .exists () && !newDataFolder .mkdirs ()) {
360+ String msg = I18n .format (tr ("Could not create directory \" {0}\" " ), newFolder .getAbsolutePath ());
361+ throw new IOException (msg );
362+ }
363+ // Copy the data files into the new folder
359364 FileUtils .copy (getDataFolder (), newDataFolder );
360365 }
366+
367+ // Change folder to the new folder
368+ folder = newFolder ;
369+
361370 }
362371
363372 /**
You can’t perform that action at this time.
0 commit comments