Skip to content

Commit 74747ed

Browse files
committed
fix: throw with empty modifier passed to Swap
1 parent cc6b05b commit 74747ed

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/Htmxor/Http/HtmxResponse.cs

+2-9
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,8 @@ public HtmxResponse ReplaceUrl(string url)
144144
/// <returns>This <see cref="HtmxResponse"/> object instance.</returns>
145145
public HtmxResponse Reswap(string modifier)
146146
{
147-
if (string.IsNullOrWhiteSpace(modifier))
148-
{
149-
headers.Remove(HtmxResponseHeaderNames.Reswap);
150-
}
151-
else
152-
{
153-
headers[HtmxResponseHeaderNames.Reswap] = modifier;
154-
}
155-
147+
ArgumentNullException.ThrowIfNullOrWhiteSpace(modifier);
148+
headers[HtmxResponseHeaderNames.Reswap] = modifier;
156149
return this;
157150
}
158151

0 commit comments

Comments
 (0)