android: Fix updating password for managed profiles
Without data source set on the profile, this caused the app to crash with a null pointer dereference when it is updated.
This commit is contained in:
+8
-1
@@ -98,7 +98,14 @@ public class VpnProfileManagedDataSource implements VpnProfileDataSource
|
|||||||
@Override
|
@Override
|
||||||
public VpnProfile getVpnProfile(UUID uuid)
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user