diff --git a/bindings/profilers/heap.cc b/bindings/profilers/heap.cc index 7c6eaad4..fa81f742 100644 --- a/bindings/profilers/heap.cc +++ b/bindings/profilers/heap.cc @@ -571,6 +571,9 @@ NAN_METHOD(HeapProfiler::GetAllocationProfile) { auto isolate = info.GetIsolate(); std::unique_ptr profile( isolate->GetHeapProfiler()->GetAllocationProfile()); + if (!profile) { + return Nan::ThrowError("Heap profiler is not enabled."); + } v8::AllocationProfile::Node* root = profile->GetRootNode(); auto state = PerIsolateData::For(isolate)->GetHeapProfilerState(); if (state) { diff --git a/bindings/profilers/wall.cc b/bindings/profilers/wall.cc index 11564677..80be444e 100644 --- a/bindings/profilers/wall.cc +++ b/bindings/profilers/wall.cc @@ -396,7 +396,7 @@ void SignalHandler::HandleProfilerSignal(int sig, return; } auto isolate = Isolate::GetCurrent(); - if (!isolate || isolate->IsDead()) { + if (!isolate) { return; } WallProfiler* prof = g_profilers.GetProfiler(isolate); diff --git a/package-lock.json b/package-lock.json index 7c42b2fe..c84ba0f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@datadog/pprof", - "version": "5.13.1", + "version": "5.13.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@datadog/pprof", - "version": "5.13.1", + "version": "5.13.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index 5cb4e842..50ddf003 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@datadog/pprof", - "version": "5.13.1", + "version": "5.13.2", "description": "pprof support for Node.js", "repository": { "type": "git",