You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libsignal-service/src/main/java/org/whispersystems/signalservice/api/push/ServiceId.kt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ sealed class ServiceId(val libSignalServiceId: LibSignalServiceId) {
60
60
/** Parses a ServiceId serialized as a byte array. Returns null if the ServiceId is invalid. */
61
61
@JvmStatic
62
62
funparseOrNull(raw:ByteArray?): ServiceId? {
63
-
if (raw ==null) {
63
+
if (raw ==null|| raw.isEmpty()) {
64
64
returnnull
65
65
}
66
66
@@ -222,7 +222,7 @@ sealed class ServiceId(val libSignalServiceId: LibSignalServiceId) {
222
222
/** Parse a byte array as a PNI, regardless if it has the type prefix byte present or not. Only use this if you are certain what you're reading is a PNI. */
223
223
@JvmStatic
224
224
funparseOrNull(raw:ByteArray?): PNI? {
225
-
returnif (raw ==null) {
225
+
returnif (raw ==null|| raw.isEmpty()) {
226
226
null
227
227
} elseif (raw.size ==17) {
228
228
ServiceId.parseOrNull(raw).let { if (it isPNI) it elsenull }
0 commit comments