Skip to content

Commit 4eedf5e

Browse files
mhdawsonRafaelGSS
authored andcommitted
module: fix recently introduced coverity warning
Signed-off-by: Michael Dawson <[email protected]> PR-URL: #50843 Reviewed-By: James M Snell <[email protected]>
1 parent fdd8c18 commit 4eedf5e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/node_modules.cc

+4
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON(
153153
return throw_invalid_package_config();
154154
}
155155

156+
// based on coverity using key with == derefs the raw value
157+
// avoid derefing if its null
158+
if (key.raw() == nullptr) continue;
159+
156160
if (key == "name") {
157161
// Though there is a key "name" with a corresponding value,
158162
// the value may not be a string or could be an invalid JSON string

0 commit comments

Comments
 (0)