add null handling and fix merge conflicts

This commit is contained in:
Aaron Qian 2023-01-04 19:20:11 -08:00
parent 8580a1f463
commit 6e0a4b058d
No known key found for this signature in database
GPG key ID: BF1A987C395B5B0E
4 changed files with 37 additions and 34 deletions

View file

@ -31,7 +31,7 @@ window.addEventListener('DOMContentLoaded', () => {
} else {
const node = document.createElement('p')
node.textContent = 'Please enter a word or phrase above'
window.getElementById('search-results').append(node)
document.getElementById('search-results')?.append(node)
}
function executeSearch (searchQuery) {
@ -48,7 +48,7 @@ window.addEventListener('DOMContentLoaded', () => {
} else {
const node = document.createElement('p')
node.textContent = 'No matches found'
window.getElementById('search-results').append(node)
document.getElementById('search-results')?.append(node)
}
})
}