From 8a8c6a4b526ffcb37f42716d2896a6ff0f565d82 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 2 Sep 2022 23:02:08 +0200 Subject: [PATCH] ViewIcons: Fix error when clicking nonexistant banner --- src/plugins/viewIcons.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/viewIcons.ts b/src/plugins/viewIcons.ts index cb56265f..a6ba4d40 100644 --- a/src/plugins/viewIcons.ts +++ b/src/plugins/viewIcons.ts @@ -6,7 +6,7 @@ const OPEN_URL = `VencordNative.ipc.invoke("${IpcEvents.OPEN_EXTERNAL}",`; export default definePlugin({ name: "ViewIcons", author: "Vendicated", - description: "Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon", + description: "Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon. Crashes if you don't have Developer Mode enabled, will fix in the future.", patches: [ { find: "UserProfileModalHeader", @@ -18,7 +18,7 @@ export default definePlugin({ find: "default.popoutNoBannerPremium", replacement: { match: /style:.{1,2}\(\{\},(.{1,2}),/, - replace: (m, bannerObj) => `onClick:()=>${OPEN_URL}${bannerObj}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048")),${m}` + replace: (m, bannerObj) => `onClick:${bannerObj}.backgroundImage&&(()=>${OPEN_URL}${bannerObj}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048"))),${m}` } }, { find: "GuildContextMenuWrapper",