Add null check for Perspective.getCanvasTextLoc

We have marked it as Nonnull but we were still sending null values
inside because of NPC name sometimes being null. Make the param nullable
and add null and empty check.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-07-30 00:19:10 +02:00
parent 1c13a1bde4
commit 5adb2d2e37

View File

@@ -373,10 +373,14 @@ public class Perspective
@Nonnull Client client,
@Nonnull Graphics2D graphics,
@Nonnull LocalPoint localLocation,
@Nonnull String text,
int zOffset
)
@Nullable String text,
int zOffset)
{
if (text == null || "".equals(text))
{
return null;
}
int plane = client.getPlane();
Point p = worldToCanvas(client, localLocation.getX(), localLocation.getY(), plane, zOffset);