Fix #592 - Add null check to DetailView #593
Open
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.
Add a null check so it doesn't blindly capture data that may not exist. This was causing an issue where the template wouldn't render if the "parent_type" was null in the database.
Description
We had an issue where emails just were not loading in
DetailView
. It took forever to figure out why this was happening, and then even longer to figure out what was responsible for it. If an email has nothing set forrelated to
, the associated field ofparent_id
isNULL
in the database, which causes thecapture
to fail and not render the template on the page.Bug Issue
Motivation and Context
Emails not containing parent data will simply not render in the template because of an error within the
capture
. Adding a null check resolves this issue and will display the detailed view of an email.How To Test This
parent_type
set tonull
, or an empty string.http://localhost:8080/#/emails/record/<id>
Types of changes
Final checklist