[pim/kalarm/release/26.08] src: Fix NODISCARD warning

David Jarvie <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 0e1466e2648f3404c1d8c66910af4224bc2e42eb by David Jarvie.
Committed on 07/08/2026 at 19:30.
Pushed by djarvie into branch 'release/26.08'.

Fix NODISCARD warning

M  +3    -3    src/messagedisplayhelper.cpp

https://invent.kde.org/pim/kalarm/-/commit/0e1466e2648f3404c1d8c66910af4224bc2e42eb

diff --git a/src/messagedisplayhelper.cpp b/src/messagedisplayhelper.cpp
index 8c96a79e0..403d11236 100644
--- a/src/messagedisplayhelper.cpp
+++ b/src/messagedisplayhelper.cpp
@@ -1,7 +1,7 @@
 /*
  *  messagedisplayhelper.cpp  -  helper class to display an alarm or error message
  *  Program:  kalarm
- *  SPDX-FileCopyrightText: 2001-2025 David Jarvie <[email protected]>
+ *  SPDX-FileCopyrightText: 2001-2026 David Jarvie <[email protected]>
  *
  *  SPDX-License-Identifier: GPL-2.0-or-later
  */
@@ -264,8 +264,8 @@ void MessageDisplayHelper::initTexts()
                             case File::Type::TextFormatted:
                                 delete mTempFile;
                                 mTempFile = new QTemporaryFile;
-                                mTempFile->open();
-                                mTempFile->write(data);
+                                if (mTempFile->open())
+                                    mTempFile->write(data);
                                 break;
                             default:
                                 break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.