Skip to content

Commit 5da5579

Browse files
committed
Fix: #8
1 parent e013b18 commit 5da5579

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

WindowsFormsApp1/Form1.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WindowsFormsApp1/Form1.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ private static int Compare(string originLrc, string translateLrc, bool hasOrigin
163163
int str1Index = originLrc.IndexOf("]");
164164
string str1Timestamp = originLrc.Substring(0, str1Index + 1);
165165
int str2Index = translateLrc.IndexOf("]");
166-
string str2Timestamp = translateLrc.Substring(0, str2Index + 1);
166+
string str2Timestamp = translateLrc.Substring(0, str2Index + 1);
167+
168+
// Fix: https://github.com/jitwxs/163MusicLyrics/issues/8
169+
if (string.IsNullOrEmpty(str1Timestamp) || string.IsNullOrEmpty(str2Timestamp))
170+
{
171+
return 1;
172+
}
167173

168174
if (str1Timestamp != str2Timestamp)
169175
{
@@ -257,7 +263,7 @@ private static string[] MergeLrc(string[] originLrcs, string[] translateLrcs, st
257263
string subStr1 = list[index];
258264
string subStr2 = c[i].Substring(str2Index);
259265

260-
// 如果任意一方歌词不存在,则不显示分隔符
266+
// Fix: https://github.com/jitwxs/163MusicLyrics/issues/7
261267
if (string.IsNullOrEmpty(subStr1) || string.IsNullOrEmpty(subStr2))
262268
{
263269
list[index] = subStr1 + subStr2;

0 commit comments

Comments
 (0)