From 267e12808e37641235737ff9dc294539b9fbc83a Mon Sep 17 00:00:00 2001 From: Lumynous Date: Sun, 20 Aug 2023 05:54:32 +0800 Subject: [PATCH] Update ShowConnections.plugin.js Fixed errors due to `c.metadata` is `undefined`. --- Plugins/ShowConnections/ShowConnections.plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/ShowConnections/ShowConnections.plugin.js b/Plugins/ShowConnections/ShowConnections.plugin.js index 15131353e9..69b6a21d48 100644 --- a/Plugins/ShowConnections/ShowConnections.plugin.js +++ b/Plugins/ShowConnections/ShowConnections.plugin.js @@ -2,7 +2,7 @@ * @name ShowConnections * @author DevilBro * @authorId 278543574059057154 - * @version 1.1.8 + * @version 1.1.9 * @description Shows the connected Accounts of a User in the UserPopout * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -87,7 +87,7 @@ module.exports = (_ => { let provider = BDFDB.LibraryModules.ConnectionProviderUtils.get(c.type); let url = _this.settings.general.openWebpage && provider.getPlatformUserUrl && provider.getPlatformUserUrl(c); let metadata = []; - if (_this.settings.general.showDetails && provider.hasMetadata) { + if (_this.settings.general.showDetails && provider.hasMetadata && c.metadata) { if (c.metadata.created_at) metadata.push(BDFDB.ReactUtils.createElement("span", {children: BDFDB.LanguageUtils.LanguageStringsFormat("CONNECTIONS_PROFILE_MEMBER_SINCE", (new Date(c.metadata.created_at)).toLocaleDateString("default", {year: "numeric", month: "long", day: "numeric"}))})); let metadataGetter = BDFDB.LibraryModules.ConnectionMetadataUtils["get" + BDFDB.StringUtils.upperCaseFirstChar(c.type)]; if (metadataGetter) metadata = metadata.concat(metadataGetter(c.metadata));