Fix: DEA crash on subject profile tab (closes #1542) #1544
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.
Description
Bug Fix: DEA crash on subject profile tab (closes #1542)
This pull request addresses the bug where the application crashes when a user navigates to the profile tab for a specific subject, as described in issue #1542.
Root Cause
The crash was caused by a data inconsistency for one of the subject's relatives. The
subjectType
object for this relative was either incomplete or missing essential properties, such astype
orname
. TheGridCommonList.jsx
component's filter, which is responsible for rendering the list of relatives, was not robust enough to catch this invalid data. As a result, an incompletesubjectType
object was passed to theSubjectProfilePicture
component, causing it to crash when it attempted to accesssubjectType.type
.Solution
To fix this, I have enhanced the filtering logic in
GridCommonList.jsx
. The filter now includes an additional check to ensure that thesubjectType
object and its required properties (type
andname
) exist before a relative is rendered.