mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #5290 from Bond-009/nullref
Fix possible null ref exception (cherry picked from commit 1442a63556e87f1318ff091df81c4ffa083de699) Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
19ff447e51
commit
ab054d6239
@ -1,3 +1,5 @@
|
|||||||
|
#nullable enable
|
||||||
|
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -29,7 +31,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The UDP server.
|
/// The UDP server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private UdpServer _udpServer;
|
private UdpServer? _udpServer;
|
||||||
private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
|
private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
|
||||||
private bool _disposed = false;
|
private bool _disposed = false;
|
||||||
|
|
||||||
@ -71,9 +73,8 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||||||
}
|
}
|
||||||
|
|
||||||
_cancellationTokenSource.Cancel();
|
_cancellationTokenSource.Cancel();
|
||||||
_udpServer.Dispose();
|
|
||||||
_cancellationTokenSource.Dispose();
|
_cancellationTokenSource.Dispose();
|
||||||
_cancellationTokenSource = null;
|
_udpServer?.Dispose();
|
||||||
_udpServer = null;
|
_udpServer = null;
|
||||||
|
|
||||||
_disposed = true;
|
_disposed = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user