From 2bc4d82d31947717d6fe32a91197c82f65d1ba64 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 24 Jun 2020 13:14:09 +0200 Subject: [PATCH] Fix crash opening UI files Add a null check, amending aaa1376576ec3a87fd2e9b94c5c0a543b0f8819a. Fixes: QTCREATORBUG-24241 Change-Id: I63e76b9d2dd10034b637f8f3cac5001b15b35d30 Reviewed-by: Robert Loehning Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 59617e4b6c7..1b59aff6a0e 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -8741,7 +8741,8 @@ BaseTextEditor *TextEditorFactoryPrivate::createEditorHelper(const TextDocumentP textEditorWidget->setMarksVisible(m_marksVisible); textEditorWidget->setParenthesesMatchingEnabled(m_paranthesesMatchinEnabled); textEditorWidget->setCodeFoldingSupported(m_codeFoldingSupported); - textEditorWidget->setOptionalActions(m_textEditorActionHandler->optionalActions()); + if (m_textEditorActionHandler) + textEditorWidget->setOptionalActions(m_textEditorActionHandler->optionalActions()); BaseTextEditor *editor = m_editorCreator(); editor->setDuplicateSupported(m_duplicatedSupported);