diff options
author | Magnus Ahltorp <map@kth.se> | 2017-03-14 14:58:41 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2017-03-14 14:58:41 +0100 |
commit | 4b75fce7f4896178224c89f5dc46a688e2d86ee0 (patch) | |
tree | 111df3672acff8e114bf5271281e367fe9b87f83 | |
parent | 515973768e37214d861fe592f25f2907567f2444 (diff) |
Handle 'null' case in statusreport.statusserver
-rw-r--r-- | src/statusreport.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/statusreport.erl b/src/statusreport.erl index f0b7503..56f55ed 100644 --- a/src/statusreport.erl +++ b/src/statusreport.erl @@ -132,7 +132,9 @@ encode_one_status(Status) when is_number(Status) -> encode_one_status(Status) when is_list(Status) -> list_to_binary(Status); encode_one_status(Status) when is_binary(Status) -> - Status. + Status; +encode_one_status(null) -> + null. encode_status({single, Status}) -> encode_one_status(Status); @@ -189,7 +191,7 @@ try_send(State) -> force_send(State) end. -report(Service, Target, Variable, Status) when is_number(Status); is_list(Status); is_binary(Status) -> +report(Service, Target, Variable, Status) when is_number(Status); is_list(Status); is_binary(Status); Status == null -> lager:debug("reporting status ~p ~p ~p ~p", [Service, Target, Variable, Status]), gen_server:cast(?MODULE, {report, Service, Target, Variable, Status}). |