Skip to content

Commit 0207cef

Browse files
author
hekra
committed
small fix
1 parent 8498ab2 commit 0207cef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/webdriver/extension_qt/quick2_view_executor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,11 +891,11 @@ void Quick2ViewCmdExecutor::ExecuteScript(const std::string& script, const base:
891891
script.c_str(),
892892
args_as_json.c_str());
893893

894-
QQuickItem *rootItem = qobject_cast<QQuickItem*>(view->contentItem());
895894
QQmlContext *rootContext = view->rootContext();
896895
QVariant p = rootContext->contextProperty("ObjectNameUtils");
897896

898897
if (p.isNull()) {
898+
QQuickItem *rootItem = qobject_cast<QQuickItem*>(view->contentItem());
899899
ObjectNameUtils* objn = new ObjectNameUtils(rootItem);
900900
rootContext->setContextProperty("ObjectNameUtils", objn);
901901
}

0 commit comments

Comments
 (0)