Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException in NpmLockfileDetectorBase #1239

Open
gbtec-georgs opened this issue Aug 27, 2024 · 0 comments
Open

NullReferenceException in NpmLockfileDetectorBase #1239

gbtec-georgs opened this issue Aug 27, 2024 · 0 comments

Comments

@gbtec-georgs
Copy link

given a package-lock.json file
and the package-lock.json file does not contain a dependencies object.
when I run the component-detection.exe (4.9.6+build.130.1d1e13bfa74ff8a3becf4dcd71954a750e1f7bc7)
then component detection succeeds
however, I get the following scary error in the output:

Could not parse Jtokens from <some-path>\package-lock.json file.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.ComponentDetection.Detectors.Npm.NpmLockfileDetectorBase.ProcessIndividualPackageJTokens(ISingleFileComponentRecorder singleFileComponentRecorder, JToken packageLockJToken, IEnumerable`1 packageJsonComponentStream, Boolean skipValidation)
   at Microsoft.ComponentDetection.Detectors.Npm.NpmLockfileDetectorBase.<>c__DisplayClass25_0.<OnFileFoundAsync>b__3(JToken token)
   at Microsoft.ComponentDetection.Detectors.Npm.NpmLockfileDetectorBase.ProcessAllPackageJTokensAsync(IComponentStream componentStream, JTokenProcessingDelegate jtokenProcessor)
   at Microsoft.ComponentDetection.Detectors.Npm.NpmLockfileDetectorBase.SafeProcessAllPackageJTokensAsync(IComponentStream componentStream, JTokenProcessingDelegate jtokenProcessor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant