Преглед изворни кода

fix: assert not empty list

Zhongwen Deng пре 3 година
родитељ
комит
83b4b658e2
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      apps/emqx/src/emqx_tls_lib.erl

+ 1 - 1
apps/emqx/src/emqx_tls_lib.erl

@@ -100,7 +100,7 @@ all_ciphers(['tlsv1.3']) ->
 all_ciphers(Versions) ->
 all_ciphers(Versions) ->
     %% assert non-empty
     %% assert non-empty
     List = lists:append([ssl:cipher_suites(all, V, openssl) || V <- Versions]),
     List = lists:append([ssl:cipher_suites(all, V, openssl) || V <- Versions]),
-    dedup(List).
+    [_ | _] = dedup(List).
 
 
 %% @doc All Pre-selected TLS ciphers.
 %% @doc All Pre-selected TLS ciphers.
 %% ssl:cipher_suites(all, V, openssl) is too slow. so we cache default ciphers.
 %% ssl:cipher_suites(all, V, openssl) is too slow. so we cache default ciphers.