You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix NullReferenceException in NpmLockfileDetectorBase when dependencies object is missing (#1437)
* Initial plan for issue
* Start investigation of NullReferenceException in NpmLockfileDetectorBase
Co-authored-by: jcfiorenzano <[email protected]>
* Fix NullReferenceException in NpmLockfileDetectorBase when dependencies object is missing
- Add null check for dependencies object in ProcessIndividualPackageJTokens method
- Use null conditional operator to safely handle missing dependencies/packages properties
- Add comprehensive test cases for both lockfile v2 (dependencies) and v3 (packages) scenarios
- Ensure backward compatibility and no regression in existing functionality
Resolves issue where package-lock.json files without dependencies/packages properties would cause NullReferenceException when calling .Children<JProperty>() on null JToken.
Co-authored-by: jcfiorenzano <[email protected]>
* Revert global.json SDK version change back to 8.0.408
Co-authored-by: jcfiorenzano <[email protected]>
* Remove TestNpmDetector_PackageLockWithNullDependenciesValue_ShouldHandleGracefully test as requested
Co-authored-by: jcfiorenzano <[email protected]>
* Remove TestNpmDetector_PackageLockWithNullPackagesValue_ShouldHandleGracefully test as requested
Co-authored-by: jcfiorenzano <[email protected]>
* Remove comment as requested
Co-authored-by: jcfiorenzano <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jcfiorenzano <[email protected]>
Co-authored-by: Greg Villicana <[email protected]>
0 commit comments