diff --git a/Dalamud/Console/ConsoleManager.cs b/Dalamud/Console/ConsoleManager.cs
index 6600069c2..4112cde2a 100644
--- a/Dalamud/Console/ConsoleManager.cs
+++ b/Dalamud/Console/ConsoleManager.cs
@@ -270,7 +270,9 @@ internal partial class ConsoleManager : IServiceType
for (var i = parsedArguments.Count; i < entry.ValidArguments.Count; i++)
{
var argument = entry.ValidArguments[i];
- if (argument.DefaultValue == null)
+
+ // If the default value is DBNull, we need to error out as that means it was not specified
+ if (argument.DefaultValue == DBNull.Value)
{
Log.Error("Not enough arguments for command {CommandName}", entryName);
PrintUsage(entry);
@@ -382,11 +384,8 @@ internal partial class ConsoleManager : IServiceType
/// The default value to use if none is specified.
/// An instance.
/// Thrown if the given type cannot be handled by the console system.
- protected static ArgumentInfo TypeToArgument(Type type, object? defaultValue = null)
+ protected static ArgumentInfo TypeToArgument(Type type, object? defaultValue)
{
- // If the default value is DBNull, we want to treat it as null
- defaultValue = defaultValue == DBNull.Value ? null : defaultValue;
-
if (type == typeof(string))
return new ArgumentInfo(ConsoleArgumentType.String, defaultValue);
@@ -490,7 +489,7 @@ internal partial class ConsoleManager : IServiceType
public ConsoleVariable(string name, string description)
: base(name, description)
{
- this.ValidArguments = new List { TypeToArgument(typeof(T)) };
+ this.ValidArguments = new List { TypeToArgument(typeof(T), null) };
}
///
@@ -500,7 +499,20 @@ internal partial class ConsoleManager : IServiceType
public override bool Invoke(IEnumerable