forked from qt-creator/qt-creator
QmlJS: Fix crash
Fixes: QTCREATORBUG-26151 Change-Id: Ibfc2a17f0eb8eb7c4804045dba9a1963249ba860 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
@@ -158,11 +158,13 @@ ObjectValue *Bind::bindObject(UiQualifiedId *qualifiedTypeNameId, UiObjectInitia
|
|||||||
_rootObjectValue = objectValue;
|
_rootObjectValue = objectValue;
|
||||||
_inlineComponents[_currentComponentName] = objectValue;
|
_inlineComponents[_currentComponentName] = objectValue;
|
||||||
if (!_currentComponentName.isEmpty()) {
|
if (!_currentComponentName.isEmpty()) {
|
||||||
if (_currentComponentName.contains('.'))
|
if (_currentComponentName.contains('.')) {
|
||||||
parentComponentName = _currentComponentName.mid(0,_currentComponentName.lastIndexOf('.'));
|
parentComponentName = _currentComponentName.mid(0,_currentComponentName.lastIndexOf('.'));
|
||||||
else
|
nextRoot = _inlineComponents.value(parentComponentName);
|
||||||
|
} else {
|
||||||
parentComponentName = "";
|
parentComponentName = "";
|
||||||
nextRoot = _inlineComponents.value(parentComponentName);
|
nextRoot = _rootObjectValue;
|
||||||
|
}
|
||||||
// we add the inline component inside its parent
|
// we add the inline component inside its parent
|
||||||
nextRoot->setMember(_currentComponentName.mid(_currentComponentName.lastIndexOf('.') + 1), objectValue);
|
nextRoot->setMember(_currentComponentName.mid(_currentComponentName.lastIndexOf('.') + 1), objectValue);
|
||||||
_rootObjectValue->setClassName(_doc->componentName() + "." + _currentComponentName); // use :: instead of .?
|
_rootObjectValue->setClassName(_doc->componentName() + "." + _currentComponentName); // use :: instead of .?
|
||||||
|
|||||||
Reference in New Issue
Block a user