Bug 718238 - Part 1: Safety for logging after computeParentFields returns null. r=nalexander

This commit is contained in:
Richard Newman 2012-02-23 08:14:05 -08:00
Родитель 9e4cb28337
Коммит ed67381683
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -264,7 +264,12 @@ public class RepoUtils {
// Need to restore the parentId since it isn't stored in content provider.
// We also take this opportunity to fix up parents for special folders,
// allowing us to map between the hierarchies used by Fennec and Places.
return logBookmark(computeParentFields(rec, parentId, parentName));
BookmarkRecord withParentFields = computeParentFields(rec, parentGUID, parentName);
if (withParentFields == null) {
// Oh dear. Something went wrong.
return null;
}
return logBookmark(withParentFields);
}
private static BookmarkRecord logBookmark(BookmarkRecord rec) {