fix: open terminal with shortcut for first time crashed

reutrn {} at end of std::vector<MimeInfo>

Issue: https://github.com/linuxdeepin/developer-center/issues/8598
This commit is contained in:
ck 2024-05-14 20:46:51 +08:00 committed by mike
parent d989a82b37
commit fa62291daf

View File

@ -695,6 +695,11 @@ QStringList ApplicationService::mimeTypes() const noexcept
return desktopFilePath.startsWith(info.directory());
});
if (cache == cacheList.cend()) {
qWarning() << "error occurred when get mimeTypes for" << desktopFilePath;
return ret;
}
const auto &info = cache->cacheInfo();
if (info) {
ret.append(info->queryTypes(id()));