Fix Null Reference Bug in Application Permissions Details #230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request addresses a bug in the application details view within PingCastle Cloud. Specifically, when clicking on an application in the "All Applications" summary to view more details, the application failed to load further information if any permission data was
null
. This was traced back to a lack of null handling in thepermissionFormatter
function. This fix ensures that all details are displayed correctly, even if some permission data is missing or null.Purpose
The purpose of this PR is to improve the stability and reliability of the application details view by ensuring that null permission data does not interrupt the user's ability to view application details. This change helps maintain a smooth and error-free user experience in the administration console.
Changes Made
permissionFormatter
Function: Added a check to handlenull
values gracefully. If the function encountersnull
, it now returns "N/A" instead of causing a failure in rendering the details.Additional Context
afdb422a-4b2a-4e07-a708-8ceed48196bf
Testing and Validation
Feedback Request
I would appreciate a review on the implementation of the null handling in the
permissionFormatter
function. Additionally, feedback on the user-facing text "N/A" would be valuable—should it perhaps be "Error occurred" or another placeholder? Guidance on this choice would be helpful.Testing and Validation
Reproducibility: To reproduce the original issue:
Manual Testing: Conducted thorough manual testing to ensure that the application now handles null values without issues. All affected views now render "N/A" where data is missing, instead of causing a rendering failure.
How to Validate This Fix
permissionFormatter
function intemplate/ReportCloudMain.js
to confirm proper null handling.components/ApplicationDetails.js
, to ensure that 'N/A' is displayed as intended.Thank you for reviewing this pull request!