mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 20:40:38 +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.relay = null;
|
||||
}
|
||||
if (this.source != null) {
|
||||
String name;
|
||||
try {
|
||||
name = m.getContactOrProfileName(this.source);
|
||||
} catch (InvalidNumberException e) {
|
||||
name = null;
|
||||
}
|
||||
this.sourceName = name;
|
||||
} else {
|
||||
this.sourceName = null;
|
||||
String name;
|
||||
try {
|
||||
name = m.getContactOrProfileName(this.source);
|
||||
} catch (InvalidNumberException | NullPointerException e) {
|
||||
name = null;
|
||||
}
|
||||
this.sourceName = name;
|
||||
this.timestamp = envelope.getTimestamp();
|
||||
if (envelope.isReceipt()) {
|
||||
this.receiptMessage = JsonReceiptMessage.deliveryReceipt(timestamp, List.of(timestamp));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue