mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 19:29:54 +01:00
Fix NPE in RecipientDatabase.
This commit is contained in:
@@ -1529,7 +1529,12 @@ public class RecipientDatabase extends Database {
|
|||||||
try (Cursor cursor = db.query(TABLE_NAME, new String[] {LAST_SESSION_RESET}, ID_WHERE, SqlUtil.buildArgs(id), null, null, null)) {
|
try (Cursor cursor = db.query(TABLE_NAME, new String[] {LAST_SESSION_RESET}, ID_WHERE, SqlUtil.buildArgs(id), null, null, null)) {
|
||||||
if (cursor.moveToFirst()) {
|
if (cursor.moveToFirst()) {
|
||||||
try {
|
try {
|
||||||
return DeviceLastResetTime.parseFrom(CursorUtil.requireBlob(cursor, LAST_SESSION_RESET));
|
byte[] serialized = CursorUtil.requireBlob(cursor, LAST_SESSION_RESET);
|
||||||
|
if (serialized != null) {
|
||||||
|
return DeviceLastResetTime.parseFrom(serialized);
|
||||||
|
} else {
|
||||||
|
return DeviceLastResetTime.newBuilder().build();
|
||||||
|
}
|
||||||
} catch (InvalidProtocolBufferException | SQLException e) {
|
} catch (InvalidProtocolBufferException | SQLException e) {
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
return DeviceLastResetTime.newBuilder().build();
|
return DeviceLastResetTime.newBuilder().build();
|
||||||
|
|||||||
Reference in New Issue
Block a user