mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-01 12:46:33 -05:00
don't crash when looking for matches when some options are null
This commit is contained in:
@@ -183,6 +183,7 @@ namespace HavenSoft.HexManiac.Core {
|
||||
}
|
||||
|
||||
public static bool MatchesPartial(this string full, string partial, bool onlyCheckLettersAndDigits = false) {
|
||||
if (full == null) return false;
|
||||
return MatchLength(full, partial, onlyCheckLettersAndDigits) == partial.Length;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using HavenSoft.HexManiac.Core.Models.Runs;
|
||||
using HavenSoft.HexManiac.Core.ViewModels.Tools;
|
||||
using HavenSoft.HexManiac.Core.ViewModels.Visitors;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
|
||||
@@ -574,6 +575,20 @@ You said no!
|
||||
Assert.Equal(2, Tool.Contents.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AnimationScript_PlaySeWithPan_CanDecode() {
|
||||
var animationpan = new List<string>(192.Range<string>(i => null));
|
||||
animationpan[63] = "sound_pan_target";
|
||||
ViewPort.Model.SetList(nameof(animationpan), animationpan);
|
||||
|
||||
ViewPort.Edit("19 00 00 00 ");
|
||||
Tool.Mode = CodeMode.AnimationScript;
|
||||
ViewPort.Goto.Execute(0);
|
||||
var help = Tool.AnimationScriptParser.GetHelp(ViewPort.Model, new HelpContext("playsewithpan mus_dummy 0", 25));
|
||||
|
||||
Assert.NotNull(help);
|
||||
}
|
||||
|
||||
// TODO test that we get an error (not an exception) if we do auto on an unformatted pointer
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user