aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2011-10-28 16:27:11 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-29 19:33:28 +0200
commitf0e6418fc1c237c1c1d71834c26a396f0b8ab28e (patch)
treec3d79b20ac6e4c9ca425ed67479f982dd0e94671 /src/declarative/debugger
parent0339d34691ecf4d67d4ef41c028a687251c2d81a (diff)
Debugger: Don't crash in v8 profiler service if client sends false on startup
Change-Id: I2a10536db749d4edd8c2958ef4c87124ddda4d47 Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'src/declarative/debugger')
-rw-r--r--src/declarative/debugger/qv8profilerservice.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declarative/debugger/qv8profilerservice.cpp b/src/declarative/debugger/qv8profilerservice.cpp
index 92a191688c..e74ccbcc8e 100644
--- a/src/declarative/debugger/qv8profilerservice.cpp
+++ b/src/declarative/debugger/qv8profilerservice.cpp
@@ -184,9 +184,11 @@ void QV8ProfilerService::stopProfiling(const QString &title)
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)