]> Entropealabs - wampex_router.git/commitdiff
default to first callee on bad index
authorChristopher <chris@entropealabs.com>
Thu, 16 Apr 2020 18:33:40 +0000 (13:33 -0500)
committerChristopher <chris@entropealabs.com>
Thu, 16 Apr 2020 18:33:40 +0000 (13:33 -0500)
lib/router/session.ex

index 2b2e80670bb5edb139f0993089ffe2dd89e44384..6a57c1c34e2d89e25364c91fe89a07a7d6a84630 100644 (file)
@@ -751,7 +751,7 @@ defmodule Wampex.Router.Session do
   end
 
   defp get_live_callee(proxy, callees, index, tries) when is_list(callees) do
-    {_id, {pid, node}} = c = Enum.at(callees, index)
+    {_id, {pid, node}} = c = Enum.at(callees, index, Enum.at(callees, 0))
 
     case GenServer.call({proxy, node}, {:is_up, pid}) do
       true ->