refactor: Check correct if null
This checks it in a more consistent way and also makes developing new databases easier as they might set the json key but set it null.
This commit is contained in:
parent
801ed31362
commit
c714574c3f
|
|
@ -211,7 +211,7 @@ class Event extends MatrixEvent {
|
|||
type: jsonPayload['type'],
|
||||
eventId: jsonPayload['event_id'] ?? '',
|
||||
senderId: jsonPayload['sender'],
|
||||
originServerTs: jsonPayload.containsKey('origin_server_ts')
|
||||
originServerTs: jsonPayload['origin_server_ts'] != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(
|
||||
jsonPayload['origin_server_ts'])
|
||||
: DateTime.now(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue