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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user