Fix TasMovie save when TasStateManager is null
This commit is contained in:
parent
74dcd81b85
commit
884110e61a
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
private void AddTasProjLumps(ZipStateSaver bs, bool isBackup = false)
|
private void AddTasProjLumps(ZipStateSaver bs, bool isBackup = false)
|
||||||
{
|
{
|
||||||
var settings = JsonConvert.SerializeObject(TasStateManager.Settings);
|
var settings = JsonConvert.SerializeObject(TasStateManager?.Settings ?? Session.Settings.DefaultTasStateManagerSettings);
|
||||||
bs.PutLump(BinaryStateLump.StateHistorySettings, tw => tw.WriteLine(settings));
|
bs.PutLump(BinaryStateLump.StateHistorySettings, tw => tw.WriteLine(settings));
|
||||||
bs.PutLump(BinaryStateLump.LagLog, tw => LagLog.Save(tw));
|
bs.PutLump(BinaryStateLump.LagLog, tw => LagLog.Save(tw));
|
||||||
bs.PutLump(BinaryStateLump.Markers, tw => tw.WriteLine(Markers.ToString()));
|
bs.PutLump(BinaryStateLump.Markers, tw => tw.WriteLine(Markers.ToString()));
|
||||||
|
@ -43,7 +43,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
bs.PutLump(BinaryStateLump.Session, tw => tw.WriteLine(JsonConvert.SerializeObject(TasSession)));
|
bs.PutLump(BinaryStateLump.Session, tw => tw.WriteLine(JsonConvert.SerializeObject(TasSession)));
|
||||||
|
|
||||||
if (!isBackup)
|
if (!isBackup && TasStateManager is not null)
|
||||||
{
|
{
|
||||||
bs.PutLump(BinaryStateLump.StateHistory, bw => TasStateManager.SaveStateHistory(bw));
|
bs.PutLump(BinaryStateLump.StateHistory, bw => TasStateManager.SaveStateHistory(bw));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue