Closed DanSM-5 closed 2 years ago
This error is not critical but it will get rid of the error message in the extensions tab
Thanks for the pull request.
I think a more streamlined approach would be to simply use customSupported?.ct?.includes(header.value.toLowerCase())
to evaluate it step by step, but that works too.
customSupported
is not evaluated at the end but assigned to e
, so it must remain there - equivalent to something like e = customCtPref && customSupported?.ct?.includes(header.value.toLowerCase()) ? customSupported : null
.
Sorry, I totally missed that part. I reverted that change on customSupported
Cool, thanks.
Edited: Remove additional changes
Issue: Using the extension I got an error
Cannot read properties of undefined (reading 'value')
and it is because the second evaluation fore
happens regardless of the existence ofheader
.Proposed fix: Evaluate
header
andvalue
first as both expressions relay on them.Disregard this part Additional changes: I noticed that
customSupported
is evaluated at the end in two expressions. IfcustomSupported.ct
andcustomSupported.ext
are present,customSupported
will evaluate to true for sure but probably the intention is to identify it first before accessing the properties, so I moved the evaluation first in line 83 and 95.