ソースを参照

Sometimes we cannot match a playlist level. Don't cause exception.

Stephen Damm 6 年 前
コミット
3076a034e9
1 ファイル変更8 行追加2 行削除
  1. 8 2
      SongBrowserPlugin/DataAccess/SongBrowserModel.cs

+ 8 - 2
SongBrowserPlugin/DataAccess/SongBrowserModel.cs

@@ -324,8 +324,14 @@ namespace SongBrowserPlugin
             CurrentEditingPlaylistLevelIds = new HashSet<string>();
             foreach (PlaylistSong ps in CurrentEditingPlaylist.songs)
             {
-                CurrentEditingPlaylistLevelIds.Add(ps.level.levelID);
-            }            
+                // Sometimes we cannot match a song
+                if (ps.level == null)
+                {
+                    continue;
+                }
+
+                CurrentEditingPlaylistLevelIds.Add(ps.level.levelID);                
+            }
 
             // Actually sort and filter
             this.ProcessSongList();