[SPIGOT-2646] NPE in MapFont.getWidth() Created: 31/Aug/16  Updated: 31/Aug/16  Resolved: 31/Aug/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Joel Paulien Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: bug

Attachments: PNG File 2016-08-31_12.30.41.png     Text File command.txt     Text File log.txt    

 Description   

An NPE is thrown for signs with certain text on them. I have uploaded 3 different files: The code to a command used for testing this in a plugin, the screenshot of the offending sign and the relevant log of the bukkit minecraft server.

I have also created a gist showing the diff of MapView.java for debugging purposes: https://gist.github.com/AlphaBlend/483f0089dc533c6521916623a6895998/revisions

The logs in log.txt are based on the modifications made in MapView.java. The offending line of code is:

result += chars.get(text.charAt(i)).getWidth();

I have also created a World Edit schematic of the sign. The JSON for the text of the sign was saved as: http://pastebin.com/99WmyDCe (I don't think JIRA would like JSON in code tags)

The text entered on the sign is:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..........................................A
............43564343434
4354354.........zzZZ!!!

This issue might be a vanilla issue, but since this involved bukkit code, I figure I'd at least try here.


Generated at Fri Mar 21 09:29:53 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.