From 50728b0463fab48b45a9fac2abe6c3453e6e96cd Mon Sep 17 00:00:00 2001 From: Matt Clarkson <mattc@catalyst.net.nz> Date: Wed, 4 Oct 2017 15:00:44 +1300 Subject: [PATCH] Fix duplicate assertion error using Redis Store --- lib/SimpleSAML/Store/Redis.php | 2 +- tests/lib/SimpleSAML/Store/RedisTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Store/Redis.php b/lib/SimpleSAML/Store/Redis.php index 25162e224..5f4c0a823 100644 --- a/lib/SimpleSAML/Store/Redis.php +++ b/lib/SimpleSAML/Store/Redis.php @@ -70,7 +70,7 @@ class Redis extends Store $result = $this->redis->get("{$type}.{$key}"); - if ($result === false) { + if ($result === false || $result === null) { return null; } diff --git a/tests/lib/SimpleSAML/Store/RedisTest.php b/tests/lib/SimpleSAML/Store/RedisTest.php index 7eecdf310..329f57113 100644 --- a/tests/lib/SimpleSAML/Store/RedisTest.php +++ b/tests/lib/SimpleSAML/Store/RedisTest.php @@ -48,7 +48,7 @@ class RedisTest extends \PHPUnit_Framework_TestCase public function getMocked($key) { - return array_key_exists($key, $this->config) ? $this->config[$key] : false; + return array_key_exists($key, $this->config) ? $this->config[$key] : null; } public function setMocked($key, $value) -- GitLab