Forráskód Böngészése

Fix Babel compilation error in vcard utils

Modified the error handling in fetchVCard() to avoid problematic destructuring
pattern that caused Babel compilation errors
JC Brand 1 hónapja
szülő
commit
ad322d1104
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      src/headless/plugins/vcard/utils.js

+ 2 - 1
src/headless/plugins/vcard/utils.js

@@ -158,7 +158,8 @@ export async function fetchVCard(jid) {
     try {
         iq = await api.sendIQ(createStanza('get', to));
     } catch (error) {
-        const { message: error_msg } = (isElement(error) ? await parseErrorStanza(error) : error) ?? {};
+        const parsed_error = isElement(error) ? await parseErrorStanza(error) : error;
+        const error_msg = parsed_error?.message;
         return {
             jid,
             stanza: isElement(error) ? error : null, // TODO: remove?