ソースを参照

Fix: MUC config form fails when no image avatar field.

John Livingston 1 年間 前
コミット
efeb38c0c6

+ 1 - 1
src/plugins/muc-views/modals/config.js

@@ -49,7 +49,7 @@ export default class MUCConfigModal extends BaseModal {
         const form_data = new FormData(/** @type {HTMLFormElement} */ (ev.target));
         const image_file = /** @type {File} */ (form_data.get('avatar_image'));
 
-        if (image_file.size) {
+        if (image_file?.size) {
             const image_data = isImageWithAlphaChannel ? image_file : await compressImage(image_file);
             const reader = new FileReader();
             reader.onloadend = async () => {

+ 1 - 1
src/plugins/profile/modals/profile.js

@@ -71,7 +71,7 @@ export default class ProfileModal extends BaseModal {
             url: form_data.get('url'),
         });
 
-        if (image_file.size) {
+        if (image_file?.size) {
             const image_data = isImageWithAlphaChannel ? image_file : await compressImage(image_file);
             const reader = new FileReader();
             reader.onloadend = async () => {