Si el parámetro no existe no se puede trimear
This commit is contained in:
parent
51f4092cf8
commit
b4e0504f97
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ export default class extends Controller {
|
|||
}
|
||||
|
||||
connect () {
|
||||
const q = new URLSearchParams(window.location.search).get('q').trim()
|
||||
const q = new URLSearchParams(window.location.search).get('q')?.trim()
|
||||
|
||||
if (q) {
|
||||
this.qTarget.value = q
|
||||
|
|
Loading…
Reference in a new issue