Skip to content

Commit

Permalink
report: fix recent coverity warning
Browse files Browse the repository at this point in the history
Fix warning about dereferencing null env

Signed-off-by: Michael Dawson <mdawson@devrus.com>
  • Loading branch information
mhdawson committed Jul 28, 2023
1 parent 8f0f17e commit 67e7828
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/node_report.cc
Expand Up @@ -857,9 +857,11 @@ std::string TriggerNodeReport(Isolate* isolate,
// Determine the required report filename. In order of priority:
// 1) supplied on API 2) configured on startup 3) default generated
if (!name.empty()) {
THROW_IF_INSUFFICIENT_PERMISSIONS(
env, permission::PermissionScope::kFileSystemWrite, name, name);
// Filename was specified as API parameter.
if (env != nullptr) {
THROW_IF_INSUFFICIENT_PERMISSIONS(
env, permission::PermissionScope::kFileSystemWrite, name, name);
// Filename was specified as API parameter.
}
filename = name;
} else {
std::string report_filename;
Expand Down

0 comments on commit 67e7828

Please sign in to comment.