Fixed crash with faulty song files
This commit is contained in:
1 parent
71251b8733
commit
55849376ba
1 file changed
+14
-8
@@ -230,9 +230,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
public static CSong LoadSong(string filePath)
|
public static CSong LoadSong(string filePath)
|
||||||
{
|
{
|
||||||
CSong song = new CSong();
|
CSong song = new CSong();
|
||||||
if (song.ReadHeader(filePath))
|
return song.ReadHeader(filePath) ? song : null;
|
||||||
return song;
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CSong(CSong song)
|
public CSong(CSong song)
|
||||||
@@ -785,11 +783,19 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
sr.Dispose();
|
sr.Dispose();
|
||||||
_FindRefrain();
|
try
|
||||||
_FindShortEnd();
|
{
|
||||||
_NotesLoaded = true;
|
_FindRefrain();
|
||||||
if (IsDuet)
|
_FindShortEnd();
|
||||||
_CheckDuet();
|
_NotesLoaded = true;
|
||||||
|
if (IsDuet)
|
||||||
|
_CheckDuet();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CBase.Log.LogError("Error loading song. An unhandled exception occured (" + e.Message + "): " + filePath);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user