Bug 747040 - Trivial guard against NPE in AndroidBrowserBookmarksRepositorySession.retrieveRecord. r=trivial, a=blocking-fennec

This commit is contained in:
Richard Newman 2012-04-21 21:46:03 -07:00
Родитель 46a49ddccd
Коммит a33cfebc3a
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -431,6 +431,12 @@ public class AndroidBrowserBookmarksRepositorySession extends AndroidBrowserRepo
String parentName = getParentName(androidParentGUID);
BookmarkRecord bookmark = AndroidBrowserBookmarksRepositorySession.bookmarkFromMirrorCursor(cur, androidParentGUID, parentName, childArray);
if (bookmark == null) {
Logger.warn(LOG_TAG, "Unable to extract bookmark from cursor. Record GUID " + recordGUID +
", parent " + androidParentGUID + "/" + androidParentID);
return null;
}
if (needsReparenting) {
Logger.warn(LOG_TAG, "Bookmark record " + recordGUID + " has a bad parent pointer. Reparenting now.");
@ -908,6 +914,8 @@ public class AndroidBrowserBookmarksRepositorySession extends AndroidBrowserRepo
if (typeString == null) {
Logger.warn(LOG_TAG, "Unsupported type code " + rowType);
return null;
} else {
Logger.trace(LOG_TAG, "Record " + guid + " has type " + typeString);
}
rec.type = typeString;