Skip to content

[appkit] Navigator.pop is called without properly checking if the modal has been opened #331

@AlexV525

Description

@AlexV525

SDK Affected

AppKit

Describe the bug

// If we aren't open, then we can't and shouldn't close
_close();
if (_context != null) {
final canPop = Navigator.of(_context!, rootNavigator: true).canPop();
if (canPop) {
Navigator.of(_context!, rootNavigator: true).pop();
}
}

The closeModal method calls navigation popping without checking if the modal has opened.

To Reproduce

// Select and connect a target wallet directly without opening the modal.
_appKitModal.selectWallet(targetWallet);
await _appKitModal.connectSelectedWallet();

Expected behavior

The navigation operation should not be called if the modal is not open.

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting customerFurther information has been requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions