Skip to content

Commit 578c749

Browse files
committed
[F] MA2Generator,遇到没有Note的音符时,会在计算Statistics时产生除0异常。
现在直接进行一次check,遇到0音符的谱面直接拒绝转换。
1 parent 7dbc2a0 commit 578c749

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

generator/mai/MA2Generator.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ protected void GenerateStatistics(StringBuilder result, Statistics stats)
302302
{
303303
if (chart != null) throw new Exception(Locale.InstanceMultipleUsage);
304304
chart = _chart;
305+
if (chart.Notes.Count == 0)
306+
{
307+
alerts.Add(new Alert(Error, Locale.NoNotesInChart));
308+
throw new ConversionException(alerts);
309+
}
305310
chart.Sort();
306311
StringBuilder result = new StringBuilder();
307312

0 commit comments

Comments
 (0)