mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
fix NPE in isPushDestination
// FREEBIE
This commit is contained in:
parent
ccc1f5e9d6
commit
e651f352bb
@ -46,11 +46,13 @@ public class DirectoryHelper {
|
||||
|
||||
public static boolean isPushDestination(Context context, Recipient recipient) {
|
||||
try {
|
||||
if (!TextSecurePreferences.isPushRegistered(context)) return false;
|
||||
if (GroupUtil.isEncodedGroup(recipient.getNumber())) return true;
|
||||
final String number = recipient.getNumber();
|
||||
|
||||
String number = recipient.getNumber();
|
||||
String e164number = Util.canonicalizeNumber(context, number);
|
||||
if (number == null) return false;
|
||||
if (!TextSecurePreferences.isPushRegistered(context)) return false;
|
||||
if (GroupUtil.isEncodedGroup(number)) return true;
|
||||
|
||||
final String e164number = Util.canonicalizeNumber(context, number);
|
||||
|
||||
return Directory.getInstance(context).isActiveNumber(e164number);
|
||||
} catch (InvalidNumberException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user