From d8dc99e2d4ecfbdddf9fa2e1bb68be550dc0a319 Mon Sep 17 00:00:00 2001 From: Guilherme Silveira Date: Tue, 26 Apr 2022 07:17:47 -0300 Subject: [PATCH 1/2] returns whether a file was opened Fixes #477 when a file is opened through the command line. --- app/src/processing/app/Base.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index bb1b37bc2..fbb10766f 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1625,7 +1625,7 @@ public class Base { nextMode = mode; } */ - handleOpenInternal(pdeFile.getAbsolutePath(), false); + return handleOpenInternal(pdeFile.getAbsolutePath(), false); } catch (IOException e) { Messages.showWarning("sketch.properties", From 7c0bbf7f2789b3bee1a001d4467881bd2a7b3b0a Mon Sep 17 00:00:00 2001 From: Guilherme Silveira Date: Tue, 26 Apr 2022 07:26:13 -0300 Subject: [PATCH 2/2] safely returning null only when there is an exception --- app/src/processing/app/Base.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index fbb10766f..27408b566 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1630,8 +1630,8 @@ public class Base { } catch (IOException e) { Messages.showWarning("sketch.properties", "Error while reading sketch.properties from\n" + parentFolder, e); + return null; } - return null; }