Commit 1ea868f
authored
Ensure Bind can handle null from GetSection (#92384)
* Ensure Bind can handle null from GetSection
IConfiguration instances may return a null value from GetSection.
We were not handling this and would throw a NullReferenceException.
* Address feedback
* Remove Moq from ConfigBinder tests1 parent 13a97c8 commit 1ea868f
3 files changed
Lines changed: 47 additions & 2 deletions
File tree
- src/libraries/Microsoft.Extensions.Configuration.Binder
- src
- tests/Common
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
301 | 306 | | |
302 | 307 | | |
303 | 308 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
891 | 897 | | |
892 | 898 | | |
Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
1767 | 1768 | | |
1768 | 1769 | | |
1769 | 1770 | | |
1770 | | - | |
| 1771 | + | |
1771 | 1772 | | |
1772 | 1773 | | |
1773 | 1774 | | |
| |||
2238 | 2239 | | |
2239 | 2240 | | |
2240 | 2241 | | |
2241 | | - | |
| 2242 | + | |
2242 | 2243 | | |
2243 | 2244 | | |
2244 | 2245 | | |
| |||
2404 | 2405 | | |
2405 | 2406 | | |
2406 | 2407 | | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
2407 | 2441 | | |
2408 | 2442 | | |
0 commit comments