#13754 - Fixed NPE when date of diagnosis is not provided#13871
#13754 - Fixed NPE when date of diagnosis is not provided#13871raulbob merged 2 commits intodevelopmentfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated null-handling in updateSurveillanceReportFromForm: reportDate is set from notificationDate only when provided; if notificationDate is absent and reportDate was unset, reportDate is initialized to current date. dateOfDiagnosis is set only when diagnosticDate is non-null; otherwise it is cleared to null. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@sormas-ui/src/main/java/de/symeda/sormas/ui/caze/notifier/CaseNotifierSideViewController.java`:
- Around line 347-348: The code currently replaces surveillanceReport.reportDate
with LocalDate.now() whenever notifierForm.getNotificationDate() is null;
instead, only synthesize a fallback date if the existing
surveillanceReport.getReportDate() is also null. Change the logic around
notifierForm.getNotificationDate() and surveillanceReport.setReportDate(...) so:
if notifierForm.getNotificationDate() != null use that; else if
surveillanceReport.getReportDate() != null preserve it (do not call
setReportDate); otherwise create and set a fallback (e.g., LocalDate.now()
converted to Date). This keeps historical reportDate values unchanged when the
form returns null.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c1af22d2-cfee-4467-b5f7-035bd40e842b
📒 Files selected for processing (1)
sormas-ui/src/main/java/de/symeda/sormas/ui/caze/notifier/CaseNotifierSideViewController.java
sormas-ui/src/main/java/de/symeda/sormas/ui/caze/notifier/CaseNotifierSideViewController.java
Outdated
Show resolved
Hide resolved
|
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=13871 |
|
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=13871 |
Fixes a NPE when the date of diagnosis is not filled in the create notification dialog.
Summary by CodeRabbit