Merge pull request #12494 from nextcloud/cache-notfound-id
return the correct value when trying to get a non existing item from cache by id
This commit is contained in:
commit
cc6c30e769
|
@ -150,6 +150,8 @@ class Cache implements ICache {
|
|||
$data = $this->partial[$file];
|
||||
}
|
||||
return $data;
|
||||
} else if (!$data) {
|
||||
return $data;
|
||||
} else {
|
||||
return self::cacheEntryFromData($data, $this->mimetypeLoader);
|
||||
}
|
||||
|
|
|
@ -553,6 +553,7 @@ class CacheTest extends \Test\TestCase {
|
|||
|
||||
function testNonExisting() {
|
||||
$this->assertFalse($this->cache->get('foo.txt'));
|
||||
$this->assertFalse($this->cache->get(-1));
|
||||
$this->assertEquals(array(), $this->cache->getFolderContents('foo'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue