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() {
2471
2471
}
2472
2472
}
2473
2473
2474
- // is there a valid library?
2475
2474
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
+
2476
2485
String libName = libFolder .getName ();
2477
2486
if (!BaseNoGui .isSanitaryName (libName )) {
2478
2487
String mess = I18n .format (_ ("The library \" {0}\" cannot be used.\n "
You can’t perform that action at this time.
0 commit comments