mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-18 12:54:25 +01:00
Move Sketchbook preparation before Theme.init()
Fixes NPE when searching for themes in portable installation
This commit is contained in:
parent
260e0c284c
commit
01519eba9c
@ -209,6 +209,20 @@ public class Base {
|
||||
parser.parseArgumentsPhase1();
|
||||
commandLine = !parser.isGuiMode();
|
||||
|
||||
BaseNoGui.checkInstallationFolder();
|
||||
|
||||
// If no path is set, get the default sketchbook folder for this platform
|
||||
if (BaseNoGui.getSketchbookPath() == null) {
|
||||
File defaultFolder = getDefaultSketchbookFolderOrPromptForIt();
|
||||
if (BaseNoGui.getPortableFolder() != null)
|
||||
PreferencesData.set("sketchbook.path", BaseNoGui.getPortableSketchbookFolder());
|
||||
else
|
||||
PreferencesData.set("sketchbook.path", defaultFolder.getAbsolutePath());
|
||||
if (!defaultFolder.exists()) {
|
||||
defaultFolder.mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
SplashScreenHelper splash;
|
||||
if (parser.isGuiMode()) {
|
||||
// Setup all notification widgets
|
||||
@ -243,20 +257,6 @@ public class Base {
|
||||
untitledFolder = FileUtils.createTempFolder("untitled" + new Random().nextInt(Integer.MAX_VALUE), ".tmp");
|
||||
DeleteFilesOnShutdown.add(untitledFolder);
|
||||
|
||||
BaseNoGui.checkInstallationFolder();
|
||||
|
||||
// If no path is set, get the default sketchbook folder for this platform
|
||||
if (BaseNoGui.getSketchbookPath() == null) {
|
||||
File defaultFolder = getDefaultSketchbookFolderOrPromptForIt();
|
||||
if (BaseNoGui.getPortableFolder() != null)
|
||||
PreferencesData.set("sketchbook.path", BaseNoGui.getPortableSketchbookFolder());
|
||||
else
|
||||
PreferencesData.set("sketchbook.path", defaultFolder.getAbsolutePath());
|
||||
if (!defaultFolder.exists()) {
|
||||
defaultFolder.mkdirs();
|
||||
}
|
||||
}
|
||||
|
||||
splash.splashText(tr("Initializing packages..."));
|
||||
BaseNoGui.initPackages();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user