Fix crash
This commit is contained in:
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user