Without data source set on the profile, this caused the app to crash
with a null pointer dereference when it is updated.
@Override
public VpnProfile getVpnProfile(UUID uuid)
{
- return mManagedConfigurationService.getManagedProfiles().get(uuid.toString());
+ final VpnProfile vpnProfile = mManagedConfigurationService.getManagedProfiles().get(uuid.toString());
+ if (vpnProfile != null)
+ {
+ final String password = mSharedPreferences.getString(uuid.toString(), vpnProfile.getPassword());
+ vpnProfile.setPassword(password);
+ vpnProfile.setDataSource(this);
+ }
+ return vpnProfile;
}
@Override