diff --git a/src/common/iflytek_ai_assistant.cpp b/src/common/iflytek_ai_assistant.cpp index 5572dea8..c9f37ca7 100644 --- a/src/common/iflytek_ai_assistant.cpp +++ b/src/common/iflytek_ai_assistant.cpp @@ -271,7 +271,7 @@ IflytekAiAssistant::CallStatus IflytekAiAssistant::stopTtsDirectly() const // BUG-301561 : disable stop tts when close tab or window #ifdef ENABLE_STOP_TTS qDebug() << "ENABLE_STOP_TTS is defined!"; - return stopTtsDirectlyInternal() + return stopTtsDirectlyInternal(); #else qDebug() << "ENABLE_STOP_TTS is not defined!, return Enable"; return Enable; diff --git a/src/editor/FlashTween.h b/src/editor/FlashTween.h index 15e685b6..18b78666 100644 --- a/src/editor/FlashTween.h +++ b/src/editor/FlashTween.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2011-2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -27,10 +27,10 @@ class FlashTween :public QObject void startX(qreal t,qreal b,qreal c,qreal d, FunSlideInertial fSlideGesture); void startY(qreal t,qreal b,qreal c,qreal d, FunSlideInertial fSlideGesture); - void stopX(){m_timerX->stop();} - void stopY(){m_timerY->stop();} - bool activeX(){return m_timerX->isActive();} - bool activeY(){return m_timerY->isActive();} + void stopX(){if (m_timerX != nullptr) m_timerX->stop();} + void stopY(){if (m_timerY != nullptr) m_timerY->stop();} + bool activeX(){return m_timerX != nullptr && m_timerX->isActive();} + bool activeY(){return m_timerY != nullptr && m_timerY->isActive();} private slots: void __runY(); diff --git a/src/editor/deletebackcommond.cpp b/src/editor/deletebackcommond.cpp index 3d61fab1..e192c0eb 100644 --- a/src/editor/deletebackcommond.cpp +++ b/src/editor/deletebackcommond.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022-2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -29,6 +29,9 @@ void DeleteBackCommand::undo() { qDebug() << "DeleteBackCommand undo - inserting text at:" << m_insertPos << ", length:" << m_delText.length(); + if (nullptr == m_edit) { + return; + } m_cursor.setPosition(m_insertPos); m_cursor.insertText(m_delText); @@ -42,6 +45,9 @@ void DeleteBackCommand::redo() { qDebug() << "DeleteBackCommand redo - deleting text at:" << m_delPos << ", length:" << m_delText.length(); + if (nullptr == m_edit) { + return; + } m_cursor.setPosition(m_delPos); m_cursor.setPosition(m_delPos + m_delText.size(), QTextCursor::KeepAnchor); m_cursor.deleteChar();