ui: Null check

This commit is contained in:
sdburns1998
2019-07-07 22:05:34 +02:00
parent f8e5ee6fb2
commit 826133f055

View File

@@ -163,7 +163,10 @@ public class ArrowMinimapOverlay extends Overlay
AffineTransform at = new AffineTransform();
if (arrowPoint.isMinimapImagePointToTarget())
{
at.translate(minimapPlayerPos.getX(), minimapPlayerPos.getY());
if (minimapPlayerPos != null)
{
at.translate(minimapPlayerPos.getX(), minimapPlayerPos.getY());
}
at.rotate(cameraAngle - theta);
at.translate(0, 66);
at.translate(minimapImageOffset.getX() - minimapImage.getWidth() / 2, minimapImageOffset.getY() - minimapImage.getHeight() / 2);
@@ -177,7 +180,10 @@ public class ArrowMinimapOverlay extends Overlay
double dY = at.getTranslateY();
//Then apply that position to an un-rotated transform
at = new AffineTransform();
at.translate(minimapPlayerPos.getX(), minimapPlayerPos.getY());
if (minimapPlayerPos != null)
{
at.translate(minimapPlayerPos.getX(), minimapPlayerPos.getY());
}
at.translate(dX, dY);
at.translate(minimapImageOffset.getX() - minimapImage.getWidth() / 2, minimapImageOffset.getY() - minimapImage.getHeight() / 2);
}