From 087ef1463f35ba0d807fd58d25428c8befb2f9bd Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Wed, 5 Nov 2025 09:16:50 +0100 Subject: [PATCH] Merge pull request #6605 from carljohnsen/bugfix/remote-sync-seek-on-nonseekstream Bugfix/Remote Synchronization tool seek on non-seekable stream --- Tools/RemoteSynchronization/LightWeightBackendManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Tools/RemoteSynchronization/LightWeightBackendManager.cs b/Tools/RemoteSynchronization/LightWeightBackendManager.cs index 25768872d..72994d212 100644 --- a/Tools/RemoteSynchronization/LightWeightBackendManager.cs +++ b/Tools/RemoteSynchronization/LightWeightBackendManager.cs @@ -271,9 +271,12 @@ namespace RemoteSynchronization Dispose(); // Dispose current backend and streaming backend. // Reset the stream, as it's in a potentially faulty state. - stream?.Seek(0, SeekOrigin.Begin); - if (resetStream) - stream?.SetLength(0); + if (stream != null && stream.CanSeek) + { + stream.Seek(0, SeekOrigin.Begin); + if (resetStream) + stream.SetLength(0); + } // Try to see if we can recover from the error. await TryRecoverFromException(ex, token).ConfigureAwait(false);