From 5e80fd21626e20844cad5f1c7fafcdb512392d89 Mon Sep 17 00:00:00 2001 From: Jack Chan Date: Mon, 11 Apr 2022 09:26:42 +1000 Subject: [PATCH] [FIX] Handle null pubsub response --- Project.toml | 2 +- src/pubsub.jl | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 24f0fc3..55da180 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Jedis" uuid = "b89ccfe0-2c5f-46f6-b89b-da3e1c2e286f" authors = ["Jack Chan "] -version = "0.2.11" +version = "0.2.12" [deps] MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d" diff --git a/src/pubsub.jl b/src/pubsub.jl index 5fff2df..003002e 100644 --- a/src/pubsub.jl +++ b/src/pubsub.jl @@ -191,7 +191,9 @@ function psubscribe(fn::Function, pattern, patterns...; stop_fn::Function=(msg) try while true - type, pttrn = msg = recv(client.socket) + msg = recv(client.socket) + isnothing(msg) && continue + type, pttrn = msg if type == "pmessage" && pttrn in client.psubscriptions fn(msg)