diff --git a/Dalamud/Plugin/Ipc/Exceptions/IpcValueNullError.cs b/Dalamud/Plugin/Ipc/Exceptions/IpcValueNullError.cs
new file mode 100644
index 000000000..04d5550a9
--- /dev/null
+++ b/Dalamud/Plugin/Ipc/Exceptions/IpcValueNullError.cs
@@ -0,0 +1,21 @@
+using System;
+
+namespace Dalamud.Plugin.Ipc.Exceptions;
+
+///
+/// This exception is thrown when a null value is passed to an IPC requiring a value type.
+///
+public class IpcValueNullError : IpcError
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Name of the IPC.
+ /// The type expected.
+ /// Index of the failing argument.
+ public IpcValueNullError(string name, Type expectedType, int index)
+ : base($"IPC {name} expects a value type({expectedType.FullName}) at index {index}, null given.")
+ {
+ // ignored
+ }
+}
diff --git a/Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs b/Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs
index 7dbda203e..c933b4cd1 100644
--- a/Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs
+++ b/Dalamud/Plugin/Ipc/Internal/CallGateChannel.cs
@@ -105,7 +105,7 @@ namespace Dalamud.Plugin.Ipc.Internal
var paramTypes = methodInfo.GetParameters()
.Select(pi => pi.ParameterType).ToArray();
- if (args.Length != paramTypes.Length)
+ if (args?.Length != paramTypes.Length)
throw new IpcLengthMismatchError(this.Name, args.Length, paramTypes.Length);
for (var i = 0; i < args.Length; i++)
@@ -113,6 +113,14 @@ namespace Dalamud.Plugin.Ipc.Internal
var arg = args[i];
var paramType = paramTypes[i];
+ if (arg == null)
+ {
+ if (paramType.IsValueType)
+ throw new IpcValueNullError(this.Name, paramType, i);
+
+ continue;
+ }
+
var argType = arg.GetType();
if (argType != paramType)
{