Skip to content

Commit a618dcb

Browse files
committed
Assign model binder strong type only when target type is matched
1 parent 8fbe67e commit a618dcb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/Vertical/Cli/Invocation/HandlerContextBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ internal HandlerContextBuilder(ICommand command, CommandHandler<TModel> handler)
6161
private Func<TModel>? _activator;
6262

6363
/// <inheritdoc />
64-
public override void AddModelBinder(Delegate modelBinder) => _modelBinder = modelBinder as ModelBinder<TModel>;
64+
public override void AddModelBinder(Delegate modelBinder) => _modelBinder ??= modelBinder as ModelBinder<TModel>;
6565

6666
/// <inheritdoc />
6767
public override void AddModelActivator(Delegate constructor) => _activator = constructor as Func<TModel>;

0 commit comments

Comments
 (0)