Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purchase.reset() crash #23

Closed
kwent opened this issue Feb 19, 2020 · 1 comment
Closed

Purchase.reset() crash #23

kwent opened this issue Feb 19, 2020 · 1 comment

Comments

@kwent
Copy link

kwent commented Feb 19, 2020

If Purchase.reset() is called before Purchase.setup(...), i know it's bad but should not crash anyway:

*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff23c7127e __exceptionPreprocess + 350
        1   libobjc.A.dylib                     0x00007fff513fbb20 objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff23c70ff8 +[NSException raise:format:arguments:] + 88
        3   Foundation                          0x00007fff256e9b51 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
        4   purchases_flutter                   0x000000010728d47d +[RCCommonFunctionality resetWithCompletionBlock:] + 333
        5   purchases_flutter                   0x000000010728b87b -[PurchasesFlutterPlugin resetWithResult:] + 123
        6   purchases_flutter                   0x000000010728a6c6 -[PurchasesFlutterPlugin handleMethodCall:result:] + 2454
        7   Flutter                             0x0000000104ecddb5 __45-[FlutterMethodChannel setMethodCa<…>
@vegaro
Copy link
Contributor

vegaro commented May 13, 2020

Sorry we took so long to reply.

We are checking if the instance exists before we do any operation. The assertion should have printed You must call setup first., I assume the error message was above the log you shared.

The best way we have to inform the developers that something is in a weird state is by doing this sort of crashes. We could log a warning, but we can't guarantee the developers will see the warning. This is the only way we have to inform that there's a wrongful operation being executed when it shouldn't. Otherwise, the app would be in a weird state or the reset wouldn't do anything.

@vegaro vegaro closed this as completed May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants