Handle location enabled setting null value

We have the notion of a null value object whose internal
value is null. If it happens that the setting was never
populated we get back the null object whose value is null
and the code does not expect null and crashes.

bug:35368238

Test: manual

Change-Id: I02c3771b94a45b4ee53e2141711eed134542ea0c
This commit is contained in:
Svetoslav Ganov
2017-02-21 13:24:09 -08:00
parent caa5a35371
commit cac64f616f

View File

@@ -1654,7 +1654,7 @@ public class SettingsProvider extends ContentProvider {
return false;
}
String oldProviders = (settingValue != null) ? settingValue.getValue() : "";
String oldProviders = !settingValue.isNull() ? settingValue.getValue() : "";
int index = oldProviders.indexOf(value);
int end = index + value.length();