瀏覽代碼

fix(iotdb): Fix function_clause when the convert value is null

firest 2 年之前
父節點
當前提交
4b3c6f8330
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb_connector.erl

+ 4 - 0
apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb_connector.erl

@@ -544,6 +544,8 @@ convert_int(Str) when is_binary(Str) ->
         _:_ ->
         _:_ ->
             convert_int(binary_to_float(Str))
             convert_int(binary_to_float(Str))
     end;
     end;
+convert_int(null) ->
+    null;
 convert_int(undefined) ->
 convert_int(undefined) ->
     null.
     null.
 
 
@@ -556,6 +558,8 @@ convert_float(Str) when is_binary(Str) ->
         _:_ ->
         _:_ ->
             convert_float(binary_to_integer(Str))
             convert_float(binary_to_integer(Str))
     end;
     end;
+convert_float(null) ->
+    null;
 convert_float(undefined) ->
 convert_float(undefined) ->
     null.
     null.