[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdev-python/1.7-py3] duchain: Do not crash if documentation context is not yet parsed
From: Sven Brauch <svenbrauch () googlemail ! com>
Date: 2015-01-25 16:39:46
Message-ID: E1YFQDy-0004tg-5r () scm ! kde ! org
[Download RAW message or body]
Git commit 23564e74d31def6e85bc539a09ebfef2de63ffde by Sven Brauch.
Committed on 25/01/2015 at 16:39.
Pushed by brauch into branch '1.7-py3'.
Do not crash if documentation context is not yet parsed
BUG:342977
M +7 -4 duchain/expressionvisitor.cpp
http://commits.kde.org/kdev-python/23564e74d31def6e85bc539a09ebfef2de63ffde
diff --git a/duchain/expressionvisitor.cpp b/duchain/expressionvisitor.cpp
index 86b8d12..d2b3cbf 100644
--- a/duchain/expressionvisitor.cpp
+++ b/duchain/expressionvisitor.cpp
@@ -669,10 +669,13 @@ AbstractType::Ptr \
ExpressionVisitor::fromBinaryOperator(AbstractType::Ptr lhs, A }
auto operatorFunctionType = func->type<FunctionType>();
DUChainReadLocker lock;
- auto object_decl = \
Helper::getDocumentationFileContext()->findDeclarations(QualifiedIdentifier("object"));
- if ( ! object_decl.isEmpty() && object_decl.first()->internalContext() == \
func->context() ) {
- // if the operator is only declared in object(), do not include its type \
(which is void).
- return AbstractType::Ptr();
+ auto context = Helper::getDocumentationFileContext();
+ if ( context ) {
+ auto object_decl = \
context->findDeclarations(QualifiedIdentifier("object")); + if ( ! \
object_decl.isEmpty() && object_decl.first()->internalContext() == func->context() ) \
{ + // if the operator is only declared in object(), do not include \
its type (which is void). + return AbstractType::Ptr();
+ }
}
return operatorFunctionType ? operatorFunctionType->returnType() : \
AbstractType::Ptr(); };
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic