From 1c357cd942411eaee7f1348bc9e848affd464312 Mon Sep 17 00:00:00 2001 From: Attila Szegedi Date: Thu, 15 Jan 2026 09:06:15 +0100 Subject: [PATCH] Guard against null heap profile --- bindings/profilers/heap.cc | 3 +++ 1 file changed, 3 insertions(+) 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) {