verify that the data is not null in search.js

This commit is contained in:
buzz-lightsnack-2007 2024-05-25 11:18:07 +08:00
parent 4558c2fb60
commit 0a3c281a49

View file

@ -358,7 +358,7 @@ class Search {
Display the search results in the log.
*/
function log (data, title) {
if (Object.keys(data).length) {
if (data ? (Object.keys(data).length) : false) {
let RESULT_STRING = ``;
(Object.keys(data)).forEach((RESULT_KEY) => {
RESULT_STRING += RESULT_KEY.concat(((title) ? data[RESULT_KEY][title] : false) ? `: `.concat(data[RESULT_KEY][title]) : ``, `\n`);