Commit d1536f3
committed
Treat null/missing CmpContext and IsMasterPage as equivalent in GetGxObject
HttpAjaxContext.GetGxObject(JArray, CmpContext, IsMasterPage) iterates the
array looking for an entry that matches the (CmpContext, IsMasterPage)
pair. The previous lookup called obj['CmpContext'].ToString() and
obj['IsMasterPage'].ToString() directly — when the array entry didn't
carry those keys, the indexer returned null and ToString() threw
NullReferenceException, which fell into the catch and made the function
return null, breaking the callers (ajax_rsp_assign_attri and similar).
Make the comparison null-safe and treat 'missing/null/empty' as
semantically equivalent to the default value:
- CmpContext: a missing/empty entry matches a null-or-empty parameter.
- IsMasterPage: a missing/empty entry matches IsMasterPage == false
(default for bool). Comparison is case-insensitive against
IsMasterPage.ToString().
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(cherry picked from commit 883f4bb)
# Conflicts:
# dotnet/src/dotnetframework/GxClasses/Core/Web/HttpAjaxContext.cs1 parent 349543d commit d1536f3
1 file changed
Lines changed: 23 additions & 26 deletions
Lines changed: 23 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
286 | 289 | | |
287 | | - | |
| 290 | + | |
288 | 291 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
307 | 304 | | |
308 | | - | |
309 | | - | |
| 305 | + | |
| 306 | + | |
310 | 307 | | |
311 | 308 | | |
312 | 309 | | |
313 | 310 | | |
314 | 311 | | |
315 | 312 | | |
316 | | - | |
| 313 | + | |
317 | 314 | | |
318 | 315 | | |
319 | 316 | | |
| |||
0 commit comments