Fix NPE inside RecentsOrientedState

Bug: 169963211
Change-Id: I86dd337dc1b862f3fa99b91b47fa250076233f96
This commit is contained in:
Hyunyoung Song 2020-10-05 16:08:35 -07:00
parent eab40983b9
commit b6aff1f56d
1 changed files with 2 additions and 1 deletions

View File

@ -539,6 +539,7 @@ public final class RecentsOrientedState implements SharedPreferences.OnSharedPre
* @return "MyObject@1234"
*/
private static String extractObjectNameAndAddress(String stringToExtract) {
return stringToExtract.substring(stringToExtract.lastIndexOf(DELIMITER_DOT));
int index = stringToExtract.lastIndexOf(DELIMITER_DOT);
return index >= 0 ? stringToExtract.substring(index) : "";
}
}