Merge pull request #4558 from deathbeam/fix-null-and-emtpy-names
Fix NPE when trying to draw null names
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);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.ui.overlay;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
@@ -67,6 +68,11 @@ public class OverlayUtil
|
||||
|
||||
public static void renderTextLocation(Graphics2D graphics, Point txtLoc, String text, Color color)
|
||||
{
|
||||
if (Strings.isNullOrEmpty(text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int x = txtLoc.getX();
|
||||
int y = txtLoc.getY();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user