Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug NPE Thrown in MessageEvent

Client Developer
Joined
Oct 12, 2015
Messages
3,781
NPE thrown in MessageEvent - I believe this is due to the fact that the player is a PMod, and therefore does not have a regular message type (as PMod messages shown even if the player is muted).

Code:
Unable to resolve chatbox message type "1" for the message "Scam lol, don't add it" sent by "Rell", please report this.
java.lang.NullPointerException
    at com.sun.javafx.text.PrismTextLayout.addTextRun(PrismTextLayout.java:755)
    at com.sun.javafx.text.GlyphLayout.addTextRun(GlyphLayout.java:140)
    at com.sun.javafx.text.GlyphLayout.breakRuns(GlyphLayout.java:210)
    at com.sun.javafx.text.PrismTextLayout.buildRuns(PrismTextLayout.java:770)
    at com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1021)
    at com.sun.javafx.text.PrismTextLayout.ensureLayout(PrismTextLayout.java:223)
    at com.sun.javafx.text.PrismTextLayout.getBounds(PrismTextLayout.java:246)
    at javafx.scene.text.Text.getLogicalBounds(Text.java:358)
    at javafx.scene.text.Text.getYRendering(Text.java:1069)
    at javafx.scene.text.Text.access$4400(Text.java:95)
    at javafx.scene.text.Text$TextAttribute$11.computeValue(Text.java:1785)
    at javafx.scene.text.Text$TextAttribute$11.computeValue(Text.java:1777)
    at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:153)
    at javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:50)
    at javafx.beans.property.ObjectPropertyBase.get(ObjectPropertyBase.java:132)
    at javafx.scene.text.Text.getImpl_caretShape(Text.java:897)
    at com.sun.javafx.scene.control.skin.TextAreaSkin$ContentView.layoutChildren(TextAreaSkin.java:283)
    at javafx.scene.Parent.layout(Parent.java:1087)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Parent.layout(Parent.java:1093)
    at javafx.scene.Scene.doLayoutPass(Scene.java:552)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2397)
    at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:354)
    at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:381)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
    at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    at java.lang.Thread.run(Thread.java:745)

@Cloud
 
Joined
Dec 10, 2014
Messages
3,332
Where is it being thrown? When you're trying to add it to your chatbox thing? Just from looking at the stacktrace, it seems similar to another issue which is caused by accessing the TextArea when not on the FX-Application thread.
 
Client Developer
Joined
Oct 12, 2015
Messages
3,781
Where is it being thrown? When you're trying to add it to your chatbox thing? Just from looking at the stacktrace, it seems similar to another issue which is caused by accessing the TextArea when not on the FX-Application thread.

Only ever seen this happen once, which is now, when a PMod is talking.
 
Joined
Dec 10, 2014
Messages
3,332
Only ever seen this happen once, which is now, when a PMod is talking.
If he's still talking, slap a Platform.runLater in there and see if that affects it. Or just remove the bit where you're adding it to the field. That way you'll be able to determine whether it's something client side, or fx-application thread related.
 
Here's a stack overflow article on a very similar looking issue. JavaFX append text to TextArea throws Exception
 
Client Developer
Joined
Oct 12, 2015
Messages
3,781
If he's still talking, slap a Platform.runLater in there and see if that affects it. Or just remove the bit where you're adding it to the field. That way you'll be able to determine whether it's something client side, or fx-application thread related.
 
Here's a stack overflow article on a very similar looking issue. JavaFX append text to TextArea throws Exception

idk dude, specifically because of this line
Unable to resolve chatbox message type "1" for the message "Scam lol, don't add it" sent by "Rell", please report this.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
idk dude, specifically because of this line
Unable to resolve chatbox message type "1" for the message "Scam lol, don't add it" sent by "Rell", please report this.
That line is just debug information so I can assign a chat type to that chat channel.
 
Client Developer
Joined
Oct 12, 2015
Messages
3,781
Fair fair, want me to do anything else with this? Just seems like too much of a coincidence that the first line a PMod says throws a messagetype NPE.
 
Joined
Dec 10, 2014
Messages
3,332
Fair fair, want me to do anything else with this? Just seems like too much of a coincidence that the first line a PMod says throws a messagetype NPE.
If you show the code, we might be able to see what's causing the NPE
 
Client Developer
Joined
Oct 12, 2015
Messages
3,781
Away from home at the moment - can you not see in SVN? :p
 
Top