Skip to content

Fix: Improve localStorage error handling in storageHelper.js#364

Closed
FrankOHara43 wants to merge 2 commits into
fossology:mainfrom
FrankOHara43:storagehelper-json-parse
Closed

Fix: Improve localStorage error handling in storageHelper.js#364
FrankOHara43 wants to merge 2 commits into
fossology:mainfrom
FrankOHara43:storagehelper-json-parse

Conversation

@FrankOHara43

Copy link
Copy Markdown

Description

After logging into the UI page hydration error was being rendered due to the localStorage value being missing or malformed.

Changes

-Added checks for null, undefined, and empty string values from localStorage.getItem(key).
-Wrapped JSON.parse in a try-catch block to prevent runtime errors if the stored value is not valid JSON.
-Added error logging for JSON parsing failures.

…compatibility

Signed-off-by: FrankOHara43 <aryaswaraj5@gmail.com>
Signed-off-by: FrankOHara43 <aryaswaraj5@gmail.com>
@FrankOHara43

Copy link
Copy Markdown
Author

Thank you for testing it out!!!

@github-actions github-actions Bot added the has merge conflicts PR has merge conflicts, require rebase label Jun 18, 2026
@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please rebase to resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has merge conflicts PR has merge conflicts, require rebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant