From 37be15261c35d732e6a254b75b77654ad0ad9d97 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Tue, 10 Sep 2019 21:44:45 +0200 Subject: Transforms some "assert" into error throws. --- src/shared/struct/map/shr_location.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/shared/struct') diff --git a/src/shared/struct/map/shr_location.erl b/src/shared/struct/map/shr_location.erl index e7d4432..f980134 100644 --- a/src/shared/struct/map/shr_location.erl +++ b/src/shared/struct/map/shr_location.erl @@ -86,7 +86,11 @@ decode (Map) -> X = maps:get(<<"x">>, Map), Y = maps:get(<<"y">>, Map), - true = (is_integer(X) and is_integer(Y)), + if + (not is_integer(X)) -> error({map, width, X}); + (not is_integer(Y)) -> error({map, height, Y}); + true -> ok + end, validate({X, Y}). -- cgit v1.2.3-70-g09d2