mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-22 19:58:48 +00:00
Fix nullability (again)
This commit is contained in:
parent
a8e5fafbb4
commit
c2748567fc
@ -11,7 +11,7 @@ internal sealed class Connection : IDisposable
|
||||
|
||||
private byte[] _pendingBuffer;
|
||||
private readonly List<byte[]> _readyBuffers = new();
|
||||
private Timer _timer;
|
||||
private Timer? _timer;
|
||||
private nint _vpConnection;
|
||||
|
||||
public Connection(nint vpConnection, object lockObject)
|
||||
@ -65,8 +65,8 @@ internal sealed class Connection : IDisposable
|
||||
{
|
||||
GCHandle handle = GCHandle.FromIntPtr(ptr);
|
||||
var connection = handle.Target as Connection;
|
||||
string host = Marshal.PtrToStringAnsi(hostPtr);
|
||||
if (connection is not null)
|
||||
string? host = Marshal.PtrToStringAnsi(hostPtr);
|
||||
if (connection is not null && host is not null)
|
||||
{
|
||||
return connection.Connect(host, port);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public sealed partial class VirtualParadiseClient
|
||||
return;
|
||||
}
|
||||
|
||||
VirtualParadiseObject virtualParadiseObject = reason == ReasonCode.Success ? await ExtractObjectAsync(sender) : null;
|
||||
VirtualParadiseObject? virtualParadiseObject = reason == ReasonCode.Success ? await ExtractObjectAsync(sender).ConfigureAwait(true) : null;
|
||||
taskCompletionSource.SetResult((reason, virtualParadiseObject));
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ public sealed partial class VirtualParadiseClient
|
||||
virtualParadiseObject = null;
|
||||
}
|
||||
|
||||
_objects.TryRemove(objectId, out VirtualParadiseObject? _);
|
||||
_objects.TryRemove(objectId, out VirtualParadiseObject _);
|
||||
|
||||
var args = new ObjectDeletedEventArgs(avatar!, objectId, virtualParadiseObject!);
|
||||
RaiseEvent(ObjectDeleted, args);
|
||||
|
@ -98,7 +98,7 @@ public sealed partial class VirtualParadiseClient
|
||||
ReasonCode reason;
|
||||
|
||||
if (!_objectCompletionSources.TryGetValue(id,
|
||||
out TaskCompletionSource<(ReasonCode, VirtualParadiseObject?)>? taskCompletionSource))
|
||||
out TaskCompletionSource<(ReasonCode, VirtualParadiseObject)>? taskCompletionSource))
|
||||
{
|
||||
taskCompletionSource = new TaskCompletionSource<(ReasonCode, VirtualParadiseObject?)>();
|
||||
_objectCompletionSources.TryAdd(id, taskCompletionSource);
|
||||
|
Loading…
Reference in New Issue
Block a user