From 01d55ef74340896d52acc29c0920d9c86c00d97d Mon Sep 17 00:00:00 2001 From: Arturas Slajus Date: Tue, 15 Sep 2020 15:47:13 +0300 Subject: [PATCH] Fix: hmGet throws an exception if one of the keys doesn't have a value https://github.com/profunktor/redis4cats/issues/364 --- .../src/main/scala/dev/profunktor/redis4cats/redis.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/effects/src/main/scala/dev/profunktor/redis4cats/redis.scala b/modules/effects/src/main/scala/dev/profunktor/redis4cats/redis.scala index 99893562..f4abb8ee 100644 --- a/modules/effects/src/main/scala/dev/profunktor/redis4cats/redis.scala +++ b/modules/effects/src/main/scala/dev/profunktor/redis4cats/redis.scala @@ -699,7 +699,7 @@ private[redis4cats] class BaseRedis[F[_]: Concurrent: ContextShift, K, V]( async .flatMap(c => F.delay(c.hmget(key, fields: _*))) .futureLift - .map(_.asScala.toList.map(kv => kv.getKey -> kv.getValue).toMap) + .map(_.asScala.toList.collect { case kv if kv.hasValue => kv.getKey -> kv.getValue }.toMap) override def hKeys(key: K): F[List[K]] = async