File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2471,8 +2471,17 @@ public void handleAddLibrary() {
24712471 }
24722472 }
24732473
2474- // is there a valid library?
24752474 File libFolder = sourceFile ;
2475+ if (FileUtils .isSubDirectory (new File (PreferencesData .get ("sketchbook.path" )), libFolder )) {
2476+ activeEditor .statusError (_ ("A subfolder of your sketchbook is not a valid library" ));
2477+ return ;
2478+ }
2479+
2480+ if (FileUtils .isSubDirectory (libFolder , new File (PreferencesData .get ("sketchbook.path" )))) {
2481+ activeEditor .statusError (_ ("You can't import a folder that contains your sketchbook" ));
2482+ return ;
2483+ }
2484+
24762485 String libName = libFolder .getName ();
24772486 if (!BaseNoGui .isSanitaryName (libName )) {
24782487 String mess = I18n .format (_ ("The library \" {0}\" cannot be used.\n "
You can’t perform that action at this time.
0 commit comments