diff --git a/package.json b/package.json index 18d618b..99b7ccc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/jrpcgen", - "version": "1.0.21", + "version": "1.0.22", "main": "lib/index.js", "license": "MIT", "packageManager": "yarn@3.1.1", diff --git a/templates/CSharp/JRpcTransport.cs b/templates/CSharp/JRpcTransport.cs index 90e6e07..5f0d2c3 100644 --- a/templates/CSharp/JRpcTransport.cs +++ b/templates/CSharp/JRpcTransport.cs @@ -5,11 +5,11 @@ namespace __NAMESPACE__; public delegate void NotifyPacket(string data); public abstract class JRpcTransport { - public event NotifyPacket OnPacket; + public event NotifyPacket? OnPacket; public abstract Task Write(string data); // TODO: Spend some time finding a better permission, but it is fine for now public void SendPacketEvent(string data) { - this.OnPacket.Invoke(data); + this.OnPacket?.Invoke(data); } }