1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bug NPE Thrown in MessageEvent

Discussion in 'Developer Support' started by Party, Jun 19, 2016.

  1. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    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 (Text):
    1. Unable to resolve chatbox message type "1" for the message "Scam lol, don't add it" sent by "Rell", please report this.
    2. java.lang.NullPointerException
    3.     at com.sun.javafx.text.PrismTextLayout.addTextRun(PrismTextLayout.java:755)
    4.     at com.sun.javafx.text.GlyphLayout.addTextRun(GlyphLayout.java:140)
    5.     at com.sun.javafx.text.GlyphLayout.breakRuns(GlyphLayout.java:210)
    6.     at com.sun.javafx.text.PrismTextLayout.buildRuns(PrismTextLayout.java:770)
    7.     at com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1021)
    8.     at com.sun.javafx.text.PrismTextLayout.ensureLayout(PrismTextLayout.java:223)
    9.     at com.sun.javafx.text.PrismTextLayout.getBounds(PrismTextLayout.java:246)
    10.     at javafx.scene.text.Text.getLogicalBounds(Text.java:358)
    11.     at javafx.scene.text.Text.getYRendering(Text.java:1069)
    12.     at javafx.scene.text.Text.access$4400(Text.java:95)
    13.     at javafx.scene.text.Text$TextAttribute$11.computeValue(Text.java:1785)
    14.     at javafx.scene.text.Text$TextAttribute$11.computeValue(Text.java:1777)
    15.     at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:153)
    16.     at javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:50)
    17.     at javafx.beans.property.ObjectPropertyBase.get(ObjectPropertyBase.java:132)
    18.     at javafx.scene.text.Text.getImpl_caretShape(Text.java:897)
    19.     at com.sun.javafx.scene.control.skin.TextAreaSkin$ContentView.layoutChildren(TextAreaSkin.java:283)
    20.     at javafx.scene.Parent.layout(Parent.java:1087)
    21.     at javafx.scene.Parent.layout(Parent.java:1093)
    22.     at javafx.scene.Parent.layout(Parent.java:1093)
    23.     at javafx.scene.Parent.layout(Parent.java:1093)
    24.     at javafx.scene.Parent.layout(Parent.java:1093)
    25.     at javafx.scene.Parent.layout(Parent.java:1093)
    26.     at javafx.scene.Parent.layout(Parent.java:1093)
    27.     at javafx.scene.Parent.layout(Parent.java:1093)
    28.     at javafx.scene.Parent.layout(Parent.java:1093)
    29.     at javafx.scene.Parent.layout(Parent.java:1093)
    30.     at javafx.scene.Parent.layout(Parent.java:1093)
    31.     at javafx.scene.Parent.layout(Parent.java:1093)
    32.     at javafx.scene.Parent.layout(Parent.java:1093)
    33.     at javafx.scene.Parent.layout(Parent.java:1093)
    34.     at javafx.scene.Parent.layout(Parent.java:1093)
    35.     at javafx.scene.Parent.layout(Parent.java:1093)
    36.     at javafx.scene.Parent.layout(Parent.java:1093)
    37.     at javafx.scene.Parent.layout(Parent.java:1093)
    38.     at javafx.scene.Parent.layout(Parent.java:1093)
    39.     at javafx.scene.Parent.layout(Parent.java:1093)
    40.     at javafx.scene.Parent.layout(Parent.java:1093)
    41.     at javafx.scene.Parent.layout(Parent.java:1093)
    42.     at javafx.scene.Parent.layout(Parent.java:1093)
    43.     at javafx.scene.Parent.layout(Parent.java:1093)
    44.     at javafx.scene.Parent.layout(Parent.java:1093)
    45.     at javafx.scene.Scene.doLayoutPass(Scene.java:552)
    46.     at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2397)
    47.     at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:355)
    48.     at java.security.AccessController.doPrivileged(Native Method)
    49.     at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:354)
    50.     at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:381)
    51.     at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
    52.     at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
    53.     at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$404(QuantumToolkit.java:319)
    54.     at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    55.     at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    56.     at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    57.     at java.lang.Thread.run(Thread.java:745)

    @Cloud
     
  2. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    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.
     
  3. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    Only ever seen this happen once, which is now, when a PMod is talking.
     
  4. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    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.
    --- Double Post Merged, Jun 19, 2016, Original Post Date: Jun 19, 2016 ---
    Here's a stack overflow article on a very similar looking issue. JavaFX append text to TextArea throws Exception
     
  5. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    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.
     
  6. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    That line is just debug information so I can assign a chat type to that chat channel.
     
  7. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    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.
     
  8. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    If you show the code, we might be able to see what's causing the NPE
     
  9. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    Away from home at the moment - can you not see in SVN? :p
     
  10. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    A little too busy to be navigating through someone elses svn looking for a file which I don't know the location of...
     
  11. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    lazy 8)
     
  12. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    Banned.
     

Share This Page

Loading...