Browse Source

handle messages gracefully when command is not set

Yury Yantsevich 2 years ago
parent
commit
d86be54e6d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/epgsql_command.erl

+ 2 - 0
src/epgsql_command.erl

@@ -67,5 +67,7 @@ execute(Command, PgSock, CmdState) ->
 
 -spec handle_message(command(), Type :: byte(), Payload :: binary() | epgsql:query_error(),
                      epgsql_sock:pg_sock(), state()) -> handle_message_return().
+handle_message(undefined = _Command, _Type, _Payload, _PgSock, _State) ->
+    unknown;
 handle_message(Command, Type, Payload, PgSock, State) ->
     Command:handle_message(Type, Payload, PgSock, State).