[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdev-python/1.7] duchain: Do not crash if documentation context is not yet parsed
From: Sven Brauch <svenbrauch () googlemail ! com>
Date: 2015-01-25 16:39:44
Message-ID: E1YFQDw-0004t2-Mn () scm ! kde ! org
[Download RAW message or body]
Git commit 30e29c5f9edb9caa6457fa9ba0e8f87e534031e6 by Sven Brauch.
Committed on 25/01/2015 at 16:39.
Pushed by brauch into branch '1.7'.
Do not crash if documentation context is not yet parsed
BUG:342977
M +7 -4 duchain/expressionvisitor.cpp
http://commits.kde.org/kdev-python/30e29c5f9edb9caa6457fa9ba0e8f87e534031e6
diff --git a/duchain/expressionvisitor.cpp b/duchain/expressionvisitor.cpp
index 6a38bb8..a6c9cb3 100644
--- a/duchain/expressionvisitor.cpp
+++ b/duchain/expressionvisitor.cpp
@@ -758,10 +758,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