This pull request addresses an issue where the version extraction in LocalWebCache.js can throw an error if the regex match returns null. This fix ensures that the code safely handles null matches, preventing a TypeError.
PR Details
Description
This change updates the version extraction logic in the persist method to safely handle cases where the regex match returns null. This prevents the TypeError caused by trying to access properties of null.
Related Issue
Motivation and Context
This change is required to make the version extraction process more robust and to prevent crashes when the manifest version is not found in the index.html.
How Has This Been Tested
This change has been tested by running the modified code and ensuring that it handles cases where the version is not found in the index.html without throwing errors.
Types of changes
[ ] Dependency change
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
[x] My code follows the code style of this project.
[ ] I have updated the documentation accordingly (index.d.ts).
This pull request addresses an issue where the version extraction in LocalWebCache.js can throw an error if the regex match returns null. This fix ensures that the code safely handles null matches, preventing a TypeError.
PR Details
Description
This change updates the version extraction logic in the
persist
method to safely handle cases where the regex match returns null. This prevents the TypeError caused by trying to access properties of null.Related Issue
Motivation and Context
This change is required to make the version extraction process more robust and to prevent crashes when the manifest version is not found in the index.html.
How Has This Been Tested
This change has been tested by running the modified code and ensuring that it handles cases where the version is not found in the index.html without throwing errors.
Types of changes
Checklist