Commit eed0241d authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Fixed a couple of null-checks/-returns.

parent 10ed2c53
......@@ -491,8 +491,8 @@ bool ResolveExpression::visit(CallAST *ast)
foreach (Symbol *overload, b->find(functionCallOp)) {
if (Function *funTy = overload->type()->asFunctionType()) {
if (maybeValidPrototype(funTy, actualArgumentCount)) {
Function *proto = instantiate(namedTy->name(), funTy)->asFunctionType();
addResult(proto->returnType().simplified(), scope);
if (Function *proto = instantiate(namedTy->name(), funTy)->asFunctionType())
addResult(proto->returnType().simplified(), scope);
}
}
}
......@@ -535,9 +535,9 @@ bool ResolveExpression::visit(ArrayAccessAST *ast)
if (ClassOrNamespace *b = _context.lookupType(namedTy->name(), scope)) {
foreach (Symbol *overload, b->find(arrayAccessOp)) {
if (Function *funTy = overload->type()->asFunctionType()) {
Function *proto = instantiate(namedTy->name(), funTy)->asFunctionType();
// ### TODO: check the actual arguments
addResult(proto->returnType().simplified(), scope);
if (Function *proto = instantiate(namedTy->name(), funTy)->asFunctionType())
// ### TODO: check the actual arguments
addResult(proto->returnType().simplified(), scope);
}
}
......
......@@ -1469,10 +1469,11 @@ const ObjectValue *Context::lookupType(const QmlJS::Document *doc, UiQualifiedId
const ObjectValue *Context::lookupType(const QmlJS::Document *doc, const QStringList &qmlTypeName)
{
const ObjectValue *objectValue = typeEnvironment(doc);
if (!objectValue)
return 0;
foreach (const QString &name, qmlTypeName) {
if (!objectValue)
return 0;
const Value *value = objectValue->property(name, this);
if (!value)
return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment