Skip to content

Commit 8e4b52c

Browse files
committed
check for empty SDK paths
1 parent 0bc2e9f commit 8e4b52c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/processing/mode/android/AndroidSDK.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class AndroidSDK {
9595
private static final String INVALID_SDK_MESSAGE =
9696
"Processing found an Android SDK, but is not valid. It could be missing " +
9797
"some files, or might not be including the required platform for " +
98-
"API " + AndroidBuild.TARGET_SDK + "<br><br>" +
98+
"API " + AndroidBuild.TARGET_SDK + ".<br><br>" +
9999
"If a valid SDK is available in a different location, " +
100100
"click \"Locate SDK path\" to select it, or \"Download SDK\" to let " +
101101
"Processing download the SDK automatically.<br><br>" +
@@ -395,8 +395,7 @@ public static AndroidSDK load(boolean checkEnvSDK, Frame editor) throws IOExcept
395395
// Give priority to preferences:
396396
// https://github.com/processing/processing-android/issues/372
397397
final String sdkPrefsPath = Preferences.get("android.sdk.path");
398-
System.out.println("Processing preferences: " + sdkPrefsPath);
399-
if (sdkPrefsPath != null) {
398+
if (sdkPrefsPath != null && !sdkPrefsPath.equals("")) {
400399
try {
401400
final AndroidSDK androidSDK = new AndroidSDK(new File(sdkPrefsPath));
402401
Preferences.set("android.sdk.path", sdkPrefsPath);
@@ -408,7 +407,7 @@ public static AndroidSDK load(boolean checkEnvSDK, Frame editor) throws IOExcept
408407
}
409408

410409
final String sdkEnvPath = Platform.getenv("ANDROID_SDK");
411-
if (sdkEnvPath != null) {
410+
if (sdkEnvPath != null && !sdkEnvPath.equals("")) {
412411
try {
413412
final AndroidSDK androidSDK = new AndroidSDK(new File(sdkEnvPath));
414413

@@ -417,7 +416,7 @@ public static AndroidSDK load(boolean checkEnvSDK, Frame editor) throws IOExcept
417416
// the option to not to use it. After this, we should go straight to
418417
// download a new SDK.
419418
int result = showEnvSDKDialog(editor);
420-
if (result == JOptionPane.NO_OPTION) {
419+
if (result != JOptionPane.YES_OPTION) {
421420
loadError = SKIP_ENV_SDK;
422421
return null;
423422
}

0 commit comments

Comments
 (0)