Prevent searchless crashing

This commit is contained in:
Bingus_Violet 2024-02-14 10:53:50 -06:00
parent ff496892d7
commit a55036e7d0
3 changed files with 9 additions and 9 deletions

View file

@ -140,10 +140,10 @@ app.get("/search", async (req, res) => {
res.write(addedHTML + html.substring(html.indexOf("{RESULTS}") + 9), () => {res.end()}) res.write(addedHTML + html.substring(html.indexOf("{RESULTS}") + 9), () => {res.end()})
}) })
// process.on('uncaughtException', (err, origin) => { process.on('uncaughtException', (err, origin) => {
// fs.writeSync( fs.writeSync(
// process.stderr.fd, process.stderr.fd,
// `Caught exception: ${err}\n` + `Caught exception: ${err}\n` +
// `Exception origin: ${origin}`, `Exception origin: ${origin}`,
// ); );
// }); });

View file

@ -19,7 +19,7 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<form action="/search"> <form action="/search">
<input type="text" placeholder="Search" name="q"> <input required type="text" placeholder="Search" name="q">
</form> </form>
</div> </div>
</div> </div>

View file

@ -19,7 +19,7 @@
</div> </div>
<div class="col-6"> <div class="col-6">
<form action="/search"> <form action="/search">
<input type="text" placeholder="Search" name="q" value="{SEARCH}"> <input required type="text" placeholder="Search" name="q" value="{SEARCH}">
</form> </form>
</div> </div>
</div> </div>