diff --git a/src/api.cc b/src/api.cc index fde3b5d050..2d850f755a 100644 --- a/src/api.cc +++ b/src/api.cc @@ -6291,12 +6291,16 @@ void V8::SetCaptureStackTraceForUncaughtExceptions( void V8::SetCounterFunction(CounterLookupCallback callback) { i::Isolate* isolate = i::Isolate::UncheckedCurrent(); + // TODO(svenpanne) The Isolate should really be a parameter. + if (isolate == NULL) return; isolate->stats_table()->SetCounterFunction(callback); } void V8::SetCreateHistogramFunction(CreateHistogramCallback callback) { i::Isolate* isolate = i::Isolate::UncheckedCurrent(); + // TODO(svenpanne) The Isolate should really be a parameter. + if (isolate == NULL) return; isolate->stats_table()->SetCreateHistogramFunction(callback); isolate->InitializeLoggingAndCounters(); isolate->counters()->ResetHistograms(); @@ -6305,6 +6309,8 @@ void V8::SetCreateHistogramFunction(CreateHistogramCallback callback) { void V8::SetAddHistogramSampleFunction(AddHistogramSampleCallback callback) { i::Isolate* isolate = i::Isolate::UncheckedCurrent(); + // TODO(svenpanne) The Isolate should really be a parameter. + if (isolate == NULL) return; isolate->stats_table()-> SetAddHistogramSampleFunction(callback); }