From 4636f7192dde3775c3b25a4b5032d7fb34e2d07e Mon Sep 17 00:00:00 2001 From: Sebastian Gift Date: Sun, 7 Jul 2024 14:54:32 +0200 Subject: [PATCH] Make relationship loading null safe, assume enemy if relationship is unknown. --- .../ds2/server/services/SingleUserRelationsService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/game/src/main/java/net/driftingsouls/ds2/server/services/SingleUserRelationsService.java b/game/src/main/java/net/driftingsouls/ds2/server/services/SingleUserRelationsService.java index 0e0f71001..82b4c6772 100644 --- a/game/src/main/java/net/driftingsouls/ds2/server/services/SingleUserRelationsService.java +++ b/game/src/main/java/net/driftingsouls/ds2/server/services/SingleUserRelationsService.java @@ -89,6 +89,10 @@ public User.Relation beziehungVon(int otherUserId) var userRelations = getUserRelationData(); var relation = userRelations.get(otherUserId); + + if(relation == null) { + return User.Relation.ENEMY; + } return User.getRelation(relation.getRelationFrom()); } }