mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
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:
parent
a7f832d6fb
commit
5da73140a5
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue