소스 검색

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 개월 전
부모
커밋
ad322d1104
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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?