File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ export class AppKit {
257257 if ( ! connection || ! connection . adapter || ! connection . adapter . connector ) return null ;
258258
259259 try {
260- return connection . adapter . connector . getProvider ( ) as T ;
260+ return connection . adapter . connector . getProvider ( ) as T | null ;
261261 } catch ( error ) {
262262 // Provider not initialized yet during session restoration
263263 // This can happen on app restart when restoring a previous connection
Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ export function useProvider(): ProviderResult {
4040 const { connection } = useSnapshot ( ConnectionsController . state ) ;
4141
4242 const returnValue = useMemo ( ( ) => {
43- if ( ! connection ) return { provider : undefined , providerType : undefined } ;
43+ if ( ! connection || ! connection . adapter ) {
44+ return { provider : undefined , providerType : undefined } ;
45+ }
4446
4547 try {
4648 return {
You can’t perform that action at this time.
0 commit comments