Fix incorrect order of flag settings

This commit is contained in:
Dean Herbert 2020-10-22 22:56:23 +09:00
parent 9f2f8d8cc7
commit 54d666604b
1 changed files with 3 additions and 2 deletions

View File

@ -194,12 +194,13 @@ public void SendFrames(FrameDataBundle data)
public void EndPlaying()
{
if (!isConnected) return;
if (!isPlaying)
throw new InvalidOperationException($"Cannot invoke {nameof(EndPlaying)} when not playing");
isPlaying = false;
if (!isConnected) return;
connection.SendAsync(nameof(ISpectatorServer.EndPlaySession), currentState);
}