diff --git a/src/main/java/cactusServer/resources/PlayersRest.java b/src/main/java/cactusServer/resources/PlayersRest.java index 6820d4f..a9aefc6 100644 --- a/src/main/java/cactusServer/resources/PlayersRest.java +++ b/src/main/java/cactusServer/resources/PlayersRest.java @@ -11,6 +11,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; +import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import org.ntlab.radishforandroidstudio.framework.model3D.Position3D; @@ -66,7 +67,10 @@ @FormParam("animationClassToStart") EmoteState.EmoteType animationClassToStart) { Player player = Instances.getInstance().updatePlayer(playerId, characterID, position, angle, cameraState, animationClassToStart); - return JSON.encode(player); + if (player != null) { + return JSON.encode(player); + } + throw new WebApplicationException(400); } @Path("/{playerId}")