mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
report: fix recent coverity warning
Fix warning about dereferencing null env Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/48954 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
f637fd46ab
commit
173aed4757
1 file changed
+7
-3
+7
-3
@@ -857,9 +857,13 @@ 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.
|
||||
// we may not always be in a great state when generating a node report
|
||||
// allow for the case where we don't have an env
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user