Skip to content

Commit 583b9e6

Browse files
committed
fix(devtools): if only root view is returned, don't cache the result
1 parent a6a0fae commit 583b9e6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test-app/runtime/src/main/cpp/v8_inspector/src/inspector/v8-dom-agent-impl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,21 @@ void V8DOMAgentImpl::getDocument(ErrorString* errorString, std::unique_ptr<proto
9292
auto errorMessage = "Error while parsing debug `DOM Node` object. ";
9393
DEBUG_WRITE_FORCE("JS Error: %s", errorMessage, errorSupportString.c_str());
9494
*errorString = errorSupportString.c_str();
95+
96+
return;
97+
} else if (domNode->getChildren(protocol::Array<protocol::DOM::Node>::create().get())->length() == 0) {
98+
*errorString = "Root view empty.";
99+
100+
return;
95101
} else {
96102
*out_root = std::move(domNode);
97103

98104
return;
99105
}
100106
} else {
101107
*errorString = "Didn't get a proper result from __getDocument call. Returning empty visual tree.";
108+
109+
return;
102110
}
103111
}
104112
}

0 commit comments

Comments
 (0)