check if value is null in tag store validity check

This commit is contained in:
Luna D 2023-05-29 11:06:39 +02:00
parent 1c5b07086e
commit a771fb1213
No known key found for this signature in database
GPG key ID: 4B1C63448394F688

View file

@ -39,7 +39,7 @@ function clearTags() {
* @returns {value is TagData}
*/
function isValidStoredTag(value) {
if ('id' in value && 'name' in value && 'images' in value && 'spoiler_image_uri' in value) {
if (value !== null && 'id' in value && 'name' in value && 'images' in value && 'spoiler_image_uri' in value) {
return typeof value.id === 'number'
&& typeof value.name === 'string'
&& typeof value.images === 'number'