OSDN Git Service

Fix potential NPE in AvdCreationDialog
authorRaphael Moll <ralf@android.com>
Wed, 9 Mar 2011 02:05:49 +0000 (18:05 -0800)
committerRaphael Moll <ralf@android.com>
Wed, 9 Mar 2011 02:05:49 +0000 (18:05 -0800)
Change-Id: Ic71e0242b34979f621e291c808b6a0ee35b711ff

sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java

index 8955c52..b545dbd 100644 (file)
@@ -709,7 +709,7 @@ final class AvdCreationDialog extends GridDialog {
         }
 
         // select the abi type
-        if (target.getAbiList().length > 0) {
+        if (target != null && target.getAbiList().length > 0) {
             mAbiTypeCombo.setEnabled(target.getAbiList().length > 1);
             String abiType = AvdInfo.getPrettyAbiType(mEditAvdInfo.getAbiType());
             int n = mAbiTypeCombo.getItemCount();
@@ -763,7 +763,6 @@ final class AvdCreationDialog extends GridDialog {
 
             sdcard = props.get(AvdManager.AVD_INI_SDCARD_SIZE);
             if (sdcard != null && sdcard.length() > 0) {
-
                 String[] values = new String[2];
                 long sdcardSize = AvdManager.parseSdcardSize(sdcard, values);