Change-Id: I2a10536db749d4edd8c2958ef4c87124ddda4d47
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
v8::HandleScope handle_scope;
v8::Handle<v8::String> v8title = v8::String::New(reinterpret_cast<const uint16_t*>(title.data()), title.size());
const v8::CpuProfile *cpuProfile = v8::CpuProfiler::StopProfiling(v8title);
- const v8::CpuProfileNode *rootNode = cpuProfile->GetTopDownRoot();
-
- d->printProfileTree(rootNode);
+ if (cpuProfile) {
+ // can happen at start
+ const v8::CpuProfileNode *rootNode = cpuProfile->GetTopDownRoot();
+ d->printProfileTree(rootNode);
+ }
}
void QV8ProfilerServicePrivate::printProfileTree(const v8::CpuProfileNode *node, int level)