Fix NPE in minimap plugin
Prevent failing on NPE when trying to access originalDotSprites or when trying to access map dots. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -106,9 +106,15 @@ public class MinimapPlugin extends Plugin
|
|||||||
originalDotSprites = Arrays.copyOf(originalDots, originalDots.length);
|
originalDotSprites = Arrays.copyOf(originalDots, originalDots.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void restoreOriginalDots()
|
private void restoreOriginalDots()
|
||||||
{
|
{
|
||||||
SpritePixels[] mapDots = client.getMapDots();
|
SpritePixels[] mapDots = client.getMapDots();
|
||||||
|
|
||||||
|
if (originalDotSprites == null || mapDots == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
System.arraycopy(originalDotSprites, 0, mapDots, 0, mapDots.length);
|
System.arraycopy(originalDotSprites, 0, mapDots, 0, mapDots.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user