Skip to content

Commit

Permalink
fix: prevent form fields from being set to null values
Browse files Browse the repository at this point in the history
Ensures form fields are only populated with valid query parameters, avoiding null value assignments.
  • Loading branch information
ccbikai committed Oct 11, 2024
1 parent c2277e1 commit 92cbdb6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/dns/dns-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export function DNSForm({ onSearch }) {
for (const key in values) {
const searchParams = new URL(document.location).searchParams
const queryValue = searchParams.get(key)
form.setValue(key, queryValue)

if (queryValue) {
form.setValue(key, queryValue)
}
}
})

Expand Down

0 comments on commit 92cbdb6

Please sign in to comment.