You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
hello @harryfear, thanks for submitting the issue -- i'm afraid i don't have time to prioritize fixing this issue myself, but i can try to be available to help, and review and merge a fix if one is offered as a pull request.
the search reveals only a handful of places where indexOf is used, so that's a good lead to get us started.
perhaps yourself, or anybody else experiencing this issue, can offer an example to reproduce the issue -- perhaps it's a specific webp image file, or a specific method of inserting it onto the page?
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
<script src="https://unpkg.com/[email protected]/dist-cjs/webp-hero.bundle.js"></script>(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.
The text was updated successfully, but these errors were encountered: