Fix crash

This commit is contained in:
Asriel Camora
2025-04-29 14:16:44 -07:00
parent 1ce3c401ea
commit d34e54c3a8
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -48,6 +48,8 @@ internal sealed unsafe class SynthesisValues(AddonSynthesis* addon)
private uint? TryGetUInt(int i) private uint? TryGetUInt(int i)
{ {
if (Addon == null)
return null;
var value = Values[i]; var value = Values[i];
return value.Type == ValueType.UInt ? return value.Type == ValueType.UInt ?
value.UInt : value.UInt :
@@ -56,6 +58,8 @@ internal sealed unsafe class SynthesisValues(AddonSynthesis* addon)
private bool? TryGetBool(int i) private bool? TryGetBool(int i)
{ {
if (Addon == null)
return null;
var value = Values[i]; var value = Values[i];
return value.Type == ValueType.Bool ? return value.Type == ValueType.Bool ?
value.Byte != 0 : value.Byte != 0 :
@@ -64,6 +68,8 @@ internal sealed unsafe class SynthesisValues(AddonSynthesis* addon)
private SeString? TryGetString(int i) private SeString? TryGetString(int i)
{ {
if (Addon == null)
return null;
var value = Values[i]; var value = Values[i];
return value.Type switch return value.Type switch
{ {
+3
View File
@@ -528,6 +528,9 @@ public sealed unsafe class SynthHelper : Window, IDisposable
private void OnUseAction(ActionType action) private void OnUseAction(ActionType action)
{ {
if (!ShouldOpen || IsCollapsed)
return;
(_, CurrentState) = new SimNoRandom().Execute(GetCurrentState(), action); (_, CurrentState) = new SimNoRandom().Execute(GetCurrentState(), action);
CurrentActionCount = CurrentState.ActionCount; CurrentActionCount = CurrentState.ActionCount;
CurrentActionStates = CurrentState.ActionStates; CurrentActionStates = CurrentState.ActionStates;