From 38b2bb9fb2fbc0d764605c9a103ff58ea26c2d61 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 1 Dec 2021 14:54:44 +0100 Subject: TextEditor: Fix crash in hover handler Amends 2dbe5c72d8e9b. Change-Id: If4343f606af1bdf25409ffaef82e44456fee7ee4 Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index ef6e169813..28fe278cab 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -342,6 +342,7 @@ public: void checkNext() { + QTC_ASSERT(m_currentHandlerIndex >= 0, return); QTC_ASSERT(m_currentHandlerIndex < m_handlers.size(), return); BaseHoverHandler *currentHandler = m_handlers[m_currentHandlerIndex]; @@ -352,6 +353,7 @@ public: void onHandlerFinished(int documentRevision, int position, int priority) { + QTC_ASSERT(m_currentHandlerIndex >= 0, return); QTC_ASSERT(m_currentHandlerIndex < m_handlers.size(), return); QTC_ASSERT(documentRevision == m_documentRevision, return); QTC_ASSERT(position == m_position, return); -- cgit v1.2.3