Commit 7a4d4e6
committed
refactor: make Sanitize.SanitizeUserInput null-safe
Accept a nullable string and return string.Empty for null input rather
than throwing NullReferenceException. This addresses the root cause of
the test regression introduced when sanitizing missionTask.Id in
AreaPolygonService and removes the need for an inline null check at
the call site.
All other callers pass values that are either guaranteed non-null by
model binding ([Required] DTO properties) or already null-checked
explicitly (UpdateRobotQuery), so the new behaviour is observationally
equivalent for them while removing a sharp edge for future callers.1 parent ab45a24 commit 7a4d4e6
2 files changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 48 | + | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments