Skip to content

Commit

Permalink
Merge pull request #73 from jitwxs/dev
Browse files Browse the repository at this point in the history
fix NetEaseMusicApiV2.GetLyricVo0 npe bugs
  • Loading branch information
jitwxs committed Apr 4, 2022
2 parents 9f415cb + a8e4210 commit 8757e44
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions MusicLyricApp/Api/NetEaseMusicApiV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,17 @@ protected override LyricVo GetLyricVo0(string songId)

if (resp.Code == 200)
{
return new LyricVo
var lyricVo = new LyricVo();
if (resp.Lrc != null)
{
Lyric = resp.Lrc.Lyric ?? string.Empty,
TranslateLyric = resp.Tlyric.Lyric ?? string.Empty
};
lyricVo.Lyric = resp.Lrc.Lyric;
}
if (resp.Tlyric != null)
{
lyricVo.TranslateLyric = resp.Tlyric.Lyric;
}

return lyricVo;
}

_logger.Error("NetEaseMusicApiV2 GetLyricVo failed, resp: {Resp}", resp.ToJson());
Expand Down

0 comments on commit 8757e44

Please sign in to comment.