Browse Source

Fixed potential null ref in builder

pull/1923/head
quin lynch 4 years ago
parent
commit
a1fd2a61e4
4 changed files with 6 additions and 4 deletions
  1. +2
    -2
      src/Discord.Net.Core/Discord.Net.Core.csproj
  2. +1
    -1
      src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs
  3. +1
    -1
      src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj
  4. +2
    -0
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 2
- 2
src/Discord.Net.Core/Discord.Net.Core.csproj View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Discord.Net.targets" />
<Import Project="../../StyleAnalyzer.targets" />
<PropertyGroup>
@@ -8,7 +8,7 @@
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net461;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0;netstandard2.1</TargetFrameworks>
<PackageId>Discord.Net.Labs.Core</PackageId>
<Version>2.3.9-pre</Version>
<Version>2.3.9-dev</Version>
<Product>Discord.Net.Labs.Core</Product>
<RepositoryUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</RepositoryUrl>
<PackageIcon>Temporary.png</PackageIcon>


+ 1
- 1
src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs View File

@@ -243,7 +243,7 @@ namespace Discord
}
}

private List<IMessageComponent> _components { get; set; }
private List<IMessageComponent> _components { get; set; } = new List<IMessageComponent>();

/// <summary>
/// Adds a list of components to the current row.


+ 1
- 1
src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj View File

@@ -8,7 +8,7 @@
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net461;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0;netstandard2.1</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>2.3.9-pre</Version>
<Version>2.3.9-dev</Version>
<RepositoryUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</RepositoryUrl>
<PackageProjectUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</PackageProjectUrl>
<PackageIcon>Temporary.png</PackageIcon>


+ 2
- 0
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -1865,6 +1865,8 @@ namespace Discord.WebSocket
{
await _gatewayLogger.DebugAsync("Received Dispatch (INTERACTION_CREATE)").ConfigureAwait(false);

// 0x546861742062696720656e6469616e20656e636f64696e67206d616b6573206d79316d687a20636c6f636b207469636b

var data = (payload as JToken).ToObject<API.Interaction>(_serializer);

SocketChannel channel = null;


Loading…
Cancel
Save