Commit 2fd1240
[BaseTasks] Fix NRE in
Use pattern matching (`if (log is TaskLoggingHelper helper)`) instead of
an unconditional `as` cast + dereference. When `log` is null or not a
TaskLoggingHelper, the original deletion exception is now silently caught
instead of being masked by a NullReferenceException.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>DeleteFile catch block (#342)1 parent 92d4a39 commit 2fd1240
2 files changed
Lines changed: 19 additions & 2 deletions
File tree
- src/Microsoft.Android.Build.BaseTasks
- tests/Microsoft.Android.Build.BaseTasks-Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
616 | | - | |
617 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
618 | 619 | | |
619 | 620 | | |
620 | 621 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
729 | 745 | | |
730 | 746 | | |
0 commit comments