From 871263d436e9137e62724a6c27909f697f43c588 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Mon, 1 Jul 2024 20:51:44 +0400 Subject: [PATCH] Check if file is successfully opened --- components/misc/scalableicon.cpp | 7 ++++++- components/platform/application.cpp | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/components/misc/scalableicon.cpp b/components/misc/scalableicon.cpp index 0b30eaf2ab..b3f4304557 100644 --- a/components/misc/scalableicon.cpp +++ b/components/misc/scalableicon.cpp @@ -36,7 +36,12 @@ namespace Misc return QIcon(); QFile iconFile(fileName); - iconFile.open(QIODevice::ReadOnly); + if (!iconFile.open(QIODevice::ReadOnly)) + { + qDebug() << "Failed to open icon file:" << fileName; + return QIcon(); + } + auto content = iconFile.readAll(); if (!content.startsWith("