Skip to content

Commit 4d33354

Browse files
committed
graceful error for dropping folder into sketch window (fixes #441)
1 parent ca0238f commit 4d33354

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

app/src/processing/app/Sketch.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,11 @@ public void handleAddFile() {
14091409
* @return true if successful.
14101410
*/
14111411
public boolean addFile(File sourceFile) {
1412+
if (sourceFile.isDirectory()) {
1413+
System.err.println("Skipping folder " + sourceFile);
1414+
System.err.println("Dragging and dropping a folder is not supported.");
1415+
return false;
1416+
}
14121417
String filename = sourceFile.getName();
14131418
File destFile = null;
14141419
String codeExtension = null;

todo.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
X fix logic for opening the correct 'main' tab in handleOpen()
33
X opening AspectHelper.js makes it the main tab
44
X through sketch.properties is not rewritten
5-
6-
7-
_ dropping folder into sketch window throws weird exception
8-
_ https://github.com/processing/processing4/issues/441
5+
X dropping folder into sketch window throws weird exception
6+
X https://github.com/processing/processing4/issues/441
97

108
_ clicking "Update All" on the Updates tab throws NPE
119
_ https://github.com/processing/processing4/issues/440

0 commit comments

Comments
 (0)