Fix minor NPE on item detail update

git-svn-id: https://zxing.googlecode.com/svn/trunk@2411 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-09-25 21:07:16 +00:00
parent a7f832d6fb
commit 5da73140a5

View file

@ -203,11 +203,12 @@ public final class HistoryManager {
oldDetails = cursor.getString(1); oldDetails = cursor.getString(1);
} }
if (oldID != null) {
String newDetails = oldDetails == null ? itemDetails : oldDetails + " : " + itemDetails; String newDetails = oldDetails == null ? itemDetails : oldDetails + " : " + itemDetails;
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
values.put(DBHelper.DETAILS_COL, newDetails); values.put(DBHelper.DETAILS_COL, newDetails);
db.update(DBHelper.TABLE_NAME, values, DBHelper.ID_COL + "=?", new String[] { oldID }); db.update(DBHelper.TABLE_NAME, values, DBHelper.ID_COL + "=?", new String[] { oldID });
}
} finally { } finally {
close(cursor, db); close(cursor, db);