@@ -119,17 +119,17 @@ internal class AppRouter(
119119 }
120120}
121121
122- private fun DeepLink.isLogin (): Boolean = login.contains(pathSegments[ 0 ] )
123- private fun DeepLink.isCashLink (): Boolean = cashLink.contains(pathSegments[ 0 ] )
124- private fun DeepLink.isToken (): Boolean = token.contains(pathSegments[ 0 ] )
122+ private fun DeepLink.isLogin (): Boolean = login.contains(pathSegments.getOrNull( 0 ) )
123+ private fun DeepLink.isCashLink (): Boolean = cashLink.contains(pathSegments.getOrNull( 0 ) )
124+ private fun DeepLink.isToken (): Boolean = token.contains(pathSegments.getOrNull( 0 ) )
125125
126126private fun DeepLink.isExternalWalletConnection (): Boolean = external.contains(pathSegments.getOrNull(0 ))
127127 && pathSegments.getOrNull(2 ) == " connected"
128128
129129private fun DeepLink.isExternalWalletSignedTransaction (): Boolean = external.contains(pathSegments.getOrNull(0 ))
130130 && pathSegments.getOrNull(2 ) == " signed"
131131
132- private fun DeepLink.isEmailVerification (): Boolean = verification.contains(pathSegments[ 0 ] )
132+ private fun DeepLink.isEmailVerification (): Boolean = verification.contains(pathSegments.getOrNull( 0 ) )
133133 && data.toUri().getQueryParameter(" email" ) != null
134134
135135private fun DeepLink.handleLoginLink (): DeeplinkType .Login ? {
@@ -152,13 +152,13 @@ private fun DeepLink.handleCashLink(): DeeplinkType.CashLink? {
152152
153153private fun DeepLink.handleTokenLink (): DeeplinkType .TokenInfo ? {
154154 val uri = data.toUri()
155- val mint = uri.pathSegments[ 1 ]
155+ val mint = uri.pathSegments.getOrNull( 1 ) ? : return null
156156 return DeeplinkType .TokenInfo (Mint (mint))
157157}
158158
159159private fun DeepLink.handleWalletConnect (): DeeplinkType .ExternalWalletConnection ? {
160160 val uri = data.toUri()
161- val wallet = uri.pathSegments[ 1 ] ? : return null
161+ val wallet = uri.pathSegments.getOrNull( 1 ) ? : return null
162162 val origin = uri.getQueryParameter(" origin" )
163163
164164 val phantomOrigin = OnRampDeeplinkOrigin .fromString(origin) ? : return null
0 commit comments