From 7bef3d549b285f8c1aa0d39f73a706cde76b0dbe Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 10 Jan 2018 12:00:37 +0100 Subject: [PATCH] [Win] Move recoverDefaultSketchbookFolder after init() stage Solves #7097; the user will be prompted if default sketchbook folder doesn't exist. If needed, the exception will be thrown by getDefaultSketchbookFolder() as in Linux/OSX implementations. --- arduino-core/src/processing/app/windows/Platform.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arduino-core/src/processing/app/windows/Platform.java b/arduino-core/src/processing/app/windows/Platform.java index 3cdb10594..6d344444f 100644 --- a/arduino-core/src/processing/app/windows/Platform.java +++ b/arduino-core/src/processing/app/windows/Platform.java @@ -44,7 +44,7 @@ import com.sun.jna.win32.W32APIOptions; public class Platform extends processing.app.Platform { private File settingsFolder; - private File defaultSketchbookFolder; + private File defaultSketchbookFolder = null; @Override public void init() throws Exception { @@ -52,7 +52,6 @@ public class Platform extends processing.app.Platform { checkPath(); recoverSettingsFolderPath(); - recoverDefaultSketchbookFolder(); } private void recoverSettingsFolderPath() throws Exception { @@ -119,6 +118,7 @@ public class Platform extends processing.app.Platform { @Override public File getDefaultSketchbookFolder() throws Exception { + recoverDefaultSketchbookFolder(); return defaultSketchbookFolder; }