Skip to content

Commit 1f4786c

Browse files
committed
LFA: fix empty lyric file
1 parent 52f7abe commit 1f4786c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/apps/LyricFA/util/MatchLyric.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ namespace LyricFA {
7373
textList.emplace_back(item.hanzi.c_str());
7474
pinyinList.emplace_back(item.pinyin.c_str());
7575
}
76+
if (textList.empty() || pinyinList.empty())
77+
continue;
7678
m_lyricDict[lyricName] = lyricInfo{textList, pinyinList};
7779
}
7880
}
@@ -162,7 +164,7 @@ namespace LyricFA {
162164
}
163165
}
164166
} else {
165-
msg = "filename: Miss lyric " + lyricName + ".txt";
167+
msg = "filename: Miss lyric " + lyricName + ".txt or lyric file is empty";
166168
return false;
167169
}
168170
return true;

0 commit comments

Comments
 (0)