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

Crash if rotating device while an alert dialog is open #100

Open
KCErb opened this issue Oct 16, 2015 · 1 comment
Open

Crash if rotating device while an alert dialog is open #100

KCErb opened this issue Oct 16, 2015 · 1 comment

Comments

@KCErb
Copy link
Contributor

KCErb commented Oct 16, 2015

If you fire up an alert dialog and rotate the phone you'll get this:

Exception raised: NoMethodError: undefined method `[]' for nil:NilClass
  from alert_dialog.rb:47 in `onCreateDialog'

so it looks like onCreateDialog is getting called again after the rotation, but @options is gone? Not sure how that's possible. If it's calling the method on the instance shouldn't the instance variable still be around?

Ah but it's a new instance . . . interesting. When I put a mp self.inspect in the onCreateDialog method then I find that before rotation I get this:

#<AlertDialog:0x72e00019>

and after I rotate, just before the crash, I get this

#<AlertDialog:0x30000019>

I'll be looking around and seeing if this is something I can fix. In the meantime, if someone else has seen this kind of thing before (new class instances on rotation) and knows the right path forward, please let me know! :)

@KCErb
Copy link
Contributor Author

KCErb commented Oct 18, 2015

Oh, I see now that this is a know TODO:

https://github.com/infinitered/bluepotion/blob/master/Rakefile#L46-L54

So now I guess the TODO has an issue along with it.

Also I think those lines from the Rakefile are meant to lock the app's orientation but my app's orientation isn't locked . . .

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

1 participant