mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-04 05:00:39 +00:00
catch NullPointerException instead of checking for null
This commit is contained in:
parent
72e89cd0fc
commit
17ccb20507
1 changed files with 6 additions and 10 deletions
|
@ -67,17 +67,13 @@ public class JsonMessageEnvelope {
|
||||||
this.sourceDevice = null;
|
this.sourceDevice = null;
|
||||||
this.relay = null;
|
this.relay = null;
|
||||||
}
|
}
|
||||||
if (this.source != null) {
|
|
||||||
String name;
|
String name;
|
||||||
try {
|
try {
|
||||||
name = m.getContactOrProfileName(this.source);
|
name = m.getContactOrProfileName(this.source);
|
||||||
} catch (InvalidNumberException e) {
|
} catch (InvalidNumberException | NullPointerException e) {
|
||||||
name = null;
|
name = null;
|
||||||
}
|
}
|
||||||
this.sourceName = name;
|
this.sourceName = name;
|
||||||
} else {
|
|
||||||
this.sourceName = null;
|
|
||||||
}
|
|
||||||
this.timestamp = envelope.getTimestamp();
|
this.timestamp = envelope.getTimestamp();
|
||||||
if (envelope.isReceipt()) {
|
if (envelope.isReceipt()) {
|
||||||
this.receiptMessage = JsonReceiptMessage.deliveryReceipt(timestamp, List.of(timestamp));
|
this.receiptMessage = JsonReceiptMessage.deliveryReceipt(timestamp, List.of(timestamp));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue