about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-10-02 19:48:24 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-10-02 19:48:24 +0200
commit6ee768b7b285382fce3270ad4cf06c71838182d8 (patch)
treed559e2dec7ceb4c446db973b5c040a708d1c5756 /app/javascript
parentf416e36f0fb68379cbb0cd019c5a8f435f9ab988 (diff)
Fix “Change subscribed languages” crashing in some situations
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js
index 55404c184..3047b434c 100644
--- a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js
+++ b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js
@@ -78,6 +78,10 @@ class SubscribedLanguagesModal extends ImmutablePureComponent {
     const language = this.props.languages.find(language => language[0] === value);
     const checked = this.state.selectedLanguages.includes(value);
 
+    if (!language) {
+      return null;
+    }
+
     return (
       <Option
         key={value}
@@ -105,7 +109,7 @@ class SubscribedLanguagesModal extends ImmutablePureComponent {
           <p className='report-dialog-modal__lead'><FormattedMessage id='subscribed_languages.lead' defaultMessage='Only posts in selected languages will appear on your home and list timelines after the change. Select none to receive posts in all languages.' /></p>
 
           <div>
-            {availableLanguages.union(selectedLanguages).map(value => this.renderItem(value))}
+            {availableLanguages.union(selectedLanguages).delete(null).map(value => this.renderItem(value))}
           </div>
 
           <div className='flex-spacer' />