check for NPE
This commit is contained in:
parent
af8e1fb32f
commit
a02961da61
1 changed files with 12 additions and 7 deletions
|
@ -1470,14 +1470,19 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
profileSwitch.profileJson = trJson.getString("profileJson");
|
profileSwitch.profileJson = trJson.getString("profileJson");
|
||||||
else {
|
else {
|
||||||
ProfileStore store = MainApp.getConfigBuilder().getActiveProfileInterface().getProfile();
|
ProfileStore store = MainApp.getConfigBuilder().getActiveProfileInterface().getProfile();
|
||||||
Profile profile = store.getSpecificProfile(profileSwitch.profileName);
|
if (store != null) {
|
||||||
if (profile != null) {
|
Profile profile = store.getSpecificProfile(profileSwitch.profileName);
|
||||||
profileSwitch.profileJson = profile.getData().toString();
|
if (profile != null) {
|
||||||
log.debug("Profile switch prefilled with JSON from local store");
|
profileSwitch.profileJson = profile.getData().toString();
|
||||||
// Update data in NS
|
log.debug("Profile switch prefilled with JSON from local store");
|
||||||
NSUpload.updateProfileSwitch(profileSwitch);
|
// Update data in NS
|
||||||
|
NSUpload.updateProfileSwitch(profileSwitch);
|
||||||
|
} else {
|
||||||
|
log.debug("JSON for profile switch doesn't exist. Ignoring: " + trJson.toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.debug("JSON for profile switch doesn't exist. Ignoring: " + trJson.toString());
|
log.debug("Store for profile switch doesn't exist. Ignoring: " + trJson.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue