From 2dc6504a77314ad3df6656f8034f5f10336e1581 Mon Sep 17 00:00:00 2001 From: Xaekai Date: Fri, 16 Jun 2017 21:37:30 -0700 Subject: [PATCH] Use a consistent pattern. --- www/js/util.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/www/js/util.js b/www/js/util.js index cc88d57a..a10ce0c9 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -94,19 +94,20 @@ function formatUserlistItem(div) { name.addClass(getNameColor(data.rank)); div.find(".profile-box").remove(); - if (div.data("meta") && div.data().meta.afk) { + var meta = div.data().meta || {}; // Not sure how this could happen. + if (meta.afk) { div.addClass("userlist_afk"); } else { div.removeClass("userlist_afk"); } - if (div.data("meta") && div.data("meta").muted) { + if (meta.muted) { div.addClass("userlist_muted"); } else { div.removeClass("userlist_muted"); } - if (div.data("meta") && div.data("meta").smuted) { + if (meta.smuted) { div.addClass("userlist_smuted"); } else { div.removeClass("userlist_smuted");