Closed harabisj closed 11 months ago
is there any actual situation where can the file contain literal null?
Because I think that unless you directly write it to the file, its impossible for null to apear there.
I'm not 100 % sure, however this code should raise the exception:
Cache::set('key', null);
Cache::get('key');
I think it sould be ok
Right, mentioned code does not produce the error.
The problem is in syntactically malformed data.json file. Currently I am unsure, how the error occurred. If the issue reappears, I'll reopen it.
src/Lemon/Cache/Cache.php line 59 assignes result of
json_decode()
to $data property of type array, however the return value of the function does not have to be an array (for example "null" is a valid JSON content being decoded intonull
).