diff --git a/libsearch/file-utils.cpp b/libsearch/file-utils.cpp index e7c0d99..4a9a45b 100644 --- a/libsearch/file-utils.cpp +++ b/libsearch/file-utils.cpp @@ -610,8 +610,10 @@ void FileUtils::getTxtContent(const QString &path, QString &textcontent) { uchardet_data_end(chardet); const char *codec = uchardet_get_charset(chardet); - if(QTextCodec::codecForName(codec) == 0) + if(QTextCodec::codecForName(codec) == nullptr) { qWarning() << "Unsupported Text encoding format" << path << QString::fromLocal8Bit(codec); + return; + } QTextStream stream(encodedString, QIODevice::ReadOnly); stream.setCodec(codec);