fix: error "undefined reading 0" on android
Massimo Melina committed
Oct 10, 2024 at 14:27 UTC
06c5ee9f8a74344052aa1f0245f74643927223f6
1 file changed
+1
-1
src/nat.ts
+1
-1
@@ -70,7 +70,7 @@ export const getNatInfo = debounceAsync(async () => {
70
console.debug('mappings found', mappings?.map(x => x.description))
71
const localIps = await getIps(false)
72
const gatewayIp = await gatewayIpPromise
73
- const localIp = res?.address || gatewayIp ? _.maxBy(localIps, x => inCommon(x, gatewayIp!)) : localIps[0]
73
+ const localIp = res?.address || (gatewayIp ? _.maxBy(localIps, x => inCommon(x, gatewayIp)) : localIps[0])
74
const internalPort = status?.https?.listening && status.https.port || status?.http?.listening && status.http.port || undefined
75
const mapped = _.find(mappings, x => x.private.host === localIp && x.private.port === internalPort)
76
const externalPort = mapped?.public.port