[inspector] fixed console.count with empty stack

BUG=chromium:644629
R=dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2372093002
Cr-Commit-Position: refs/heads/master@{#39786}
This commit is contained in:
kozyatinskiy 2016-09-27 10:11:21 -07:00 committed by Commit bot
parent 263c20d36c
commit 4dffc8a700

View File

@ -344,9 +344,10 @@ void V8Console::countCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
if (title.isEmpty()) {
std::unique_ptr<V8StackTraceImpl> stackTrace =
V8StackTraceImpl::capture(nullptr, 0, 1);
if (stackTrace)
if (stackTrace && !stackTrace->isEmpty()) {
identifier = toString16(stackTrace->topSourceURL()) + ":" +
String16::fromInteger(stackTrace->topLineNumber());
}
} else {
identifier = title + "@";
}