mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 10:35: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) {
|
public static boolean isPushDestination(Context context, Recipient recipient) {
|
||||||
try {
|
try {
|
||||||
if (!TextSecurePreferences.isPushRegistered(context)) return false;
|
final String number = recipient.getNumber();
|
||||||
if (GroupUtil.isEncodedGroup(recipient.getNumber())) return true;
|
|
||||||
|
|
||||||
String number = recipient.getNumber();
|
if (number == null) return false;
|
||||||
String e164number = Util.canonicalizeNumber(context, number);
|
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);
|
return Directory.getInstance(context).isActiveNumber(e164number);
|
||||||
} catch (InvalidNumberException e) {
|
} catch (InvalidNumberException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user