Fixed probable ILocational NPEs.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment
2019-10-05 11:41:13 +00:00
parent df5b49e250
commit 23015a4ae5
15 changed files with 225 additions and 0 deletions

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -76,6 +76,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -85,6 +90,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -94,6 +104,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@@ -70,6 +70,11 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.FRONT == Position.getPosition(this, target); return Position.FRONT == Position.getPosition(this, target);
} }
@@ -79,6 +84,11 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.SIDE == Position.getPosition(this, target); return Position.SIDE == Position.getPosition(this, target);
} }
@@ -88,6 +98,11 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
if (target == null)
{
return false;
}
return Position.BACK == Position.getPosition(this, target); return Position.BACK == Position.getPosition(this, target);
} }
} }