codenameone - Codename One - ToastBar NullPointerException -


if user clicks multiple times fast enough on button shows toastbar - toastbar throws nullpointerexception.

stack:

java.lang.nullpointerexception     (code 1) @ com.codename1.components.toastbar.updatestatus(toastbar.java:602)     @ com.codename1.components.toastbar.access$300(toastbar.java:84)     @ com.codename1.components.toastbar$2.run(toastbar.java:638)     @ com.codename1.ui.display.processserialcalls(display.java:1101)     @ com.codename1.ui.display.edtloopimpl(display.java:1045)     @ com.codename1.ui.display.invokeandblock(display.java:1154)     @ com.codename1.ui.display.invokeandblock(display.java:1191)     @ com.codename1.ui.animationmanager.addanimationandblock(animationmanager.java:105)     @ com.codename1.ui.componentselector.animateunlayoutandwait(componentselector.java:3584)     @ com.codename1.ui.componentselector.slideupandwait(componentselector.java:1036)     @ com.codename1.components.toastbar.setvisible(toastbar.java:787)     @ com.codename1.components.toastbar.updatestatus(toastbar.java:502)     @ com.codename1.components.toastbar.access$300(toastbar.java:84)     @ com.codename1.components.toastbar$2.run(toastbar.java:638)     @ com.codename1.ui.display.processserialcalls(display.java:1101)     @ com.codename1.ui.display.edtloopimpl(display.java:1045)     @ com.codename1.ui.display.invokeandblock(display.java:1154)     @ com.codename1.ui.display.invokeandblock(display.java:1191)     @ com.codename1.ui.animationmanager.addanimationandblock(animationmanager.java:105)     @ com.codename1.ui.container.replacecomponents(container.java:869)     @ com.codename1.ui.container.replaceandwait(container.java:744)     @ com.codename1.components.toastbar.updatestatus(toastbar.java:602)     @ com.codename1.components.toastbar.access$300(toastbar.java:84)     @ com.codename1.components.toastbar$2.run(toastbar.java:638)     @ com.codename1.ui.display.processserialcalls(display.java:1101)     @ com.codename1.ui.display.edtloopimpl(display.java:1045)     @ com.codename1.ui.display.invokeandblock(display.java:1154)     @ com.codename1.ui.display.invokeandblock(display.java:1191)     @ com.codename1.ui.animationmanager.addanimationandblock(animationmanager.java:105)     @ com.codename1.ui.container.replacecomponents(container.java:869)     @ com.codename1.ui.container.replaceandwait(container.java:744)     @ com.codename1.components.toastbar.updatestatus(toastbar.java:602)     @ com.codename1.components.toastbar.access$300(toastbar.java:84)     @ com.codename1.components.toastbar$status.show(toastbar.java:325)     @ com.codename1.components.toastbar.showmessage(toastbar.java:820)     @ com.codename1.components.toastbar.showmessage(toastbar.java:830)     @ com.codename1.components.toastbar.showerrormessage(toastbar.java:858)     (code 2) @ com.somesite.someapp.somepackage.digitroller.copytoclipboard(digitroller.java:122) 

(code 1): toastbar.java, line 602

c.label.getparent().replaceandwait(c.label, newlabel, commontransitions.createcover(commontransitions.slide_vertical, true, 300)); 

(code 2): digitroller.java

protected void copytoclipboard () {         clipboard.copystring(stoken);         toastbar.showerrormessage("copied " + stoken, 1000);     } 

copytoclipboard() invoked actionlistener:

btncopy.addactionlistener((e)-> {             this.copytoclipboard();         }); 

after displaying exception details in dialog app freezes or stops animations it's own decision. extremely simple way crash application.

this seems bug, added potential workaround here.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -