diff --git a/language/codegen/basicrefactoring.cpp b/language/codegen/basicrefactoring.cpp --- a/language/codegen/basicrefactoring.cpp +++ b/language/codegen/basicrefactoring.cpp @@ -209,7 +209,8 @@ KDevelop::IndexedDeclaration BasicRefactoring::declarationUnderCursor(bool allowUse) { KTextEditor::View* view = ICore::self()->documentController()->activeTextDocumentView(); - Q_ASSERT(view); + if (!view) + return KDevelop::IndexedDeclaration(); KTextEditor::Document* doc = view->document(); DUChainReadLocker lock; @@ -261,6 +262,10 @@ IndexedDeclaration decl = action->data().value(); if(!decl.isValid()) decl = declarationUnderCursor(); + + if(!decl.isValid()) + return; + startInteractiveRename(decl); } }