Shikhar13 / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

re-using the same dialog cause an exception #288

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When re-using the same dialog and calling its show method for the second time a 
nullpointerexception is thrown with the following stacktrace
java.lang.NullPointerException
    at com.codename1.ui.plaf.Style.removeListeners(Style.java:1637)
    at com.codename1.ui.Form.showModal(Form.java:1324)
    at com.codename1.ui.Dialog.showModal(Dialog.java:1050)
    at com.codename1.ui.Dialog.show(Dialog.java:464)
    at com.codename1.ui.Dialog.showImpl(Dialog.java:1004)
    at com.codename1.ui.Dialog.show(Dialog.java:992)

the following line should be added to removeListeners method
"if (listeners != null)"
this line appear also in removeStyleListener method

What steps will reproduce the problem?
1. create a form with a button
2. create a dialog with no title and store it in a member variable
3. connect the button on the form to the dialog show method and press it more 
than once.

What is the expected output? What do you see instead?
Expected result: the dialog should display itself normally
Actual result: a nullpointerexception is thrown for its second attempt

What version of the product are you using? On what operating system?
iOS simulator

Please provide any additional information below.

Original issue reported on code.google.com by s...@the-futuresoft.com on 5 Aug 2012 at 10:08

GoogleCodeExporter commented 9 years ago

Original comment by shai.almog on 5 Aug 2012 at 10:23

GoogleCodeExporter commented 9 years ago
fixed, thanks

Original comment by cf27...@gmail.com on 5 Aug 2012 at 11:32

GoogleCodeExporter commented 9 years ago
Hey Shai,
Did you push this fix also to the binaries yet? there doesnt seem to be an 
update to the project libs and the issue is annoying when trying to test on the 
simulator.

Original comment by s...@the-futuresoft.com on 7 Aug 2012 at 9:09

GoogleCodeExporter commented 9 years ago
We only push binaries with updates to the plugin.

Original comment by shai.almog on 8 Aug 2012 at 3:30