-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Description
I encountered a runtime error in the webp-hero library that seems to stem from the use of the indexOf method on a null object. The error message is:
null is not an object (evaluating 't.indexOf')
This occurs when trying to process WebP images using the library.
Steps to Reproduce
(1) Include the webp-hero library from unpkg:
(2) Attempt to decode a WebP image (specific steps that lead to the issue would be helpful here, including any relevant code snippets).
Expected Behavior
The library should either successfully process the WebP image or handle the error more gracefully if the data isn't as expected.
Actual Behavior
The script fails with a TypeError due to attempting to call .indexOf on a null object, causing script execution to halt.
Possible Solution
It might be beneficial to check if the variable is null or undefined before attempting to access .indexOf. This could be a simple null check or a more comprehensive error handling update in the library.