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

Merge pull request #5289 from arnaud-jacquemin/staging

Fix #5272 Instagram import fails silently if there's one post only in posts_1.json
daniel 9 hónapja
szülő
commit
0ddab939ad
1 módosított fájl, 4 hozzáadás és 0 törlés
  1. 4 0
      resources/assets/components/AccountImport.vue

+ 4 - 0
resources/assets/components/AccountImport.vue

@@ -369,6 +369,10 @@
             async filterPostMeta(media) {
             	let fbfix = await this.fixFacebookEncoding(media);
                 let json = JSON.parse(fbfix);
+                /* Sometimes the JSON isn't an array, when there's only one post */
+                if (!Array.isArray(json)) {
+                    json = new Array(json);
+                }
                 let res = json.filter(j => {
                     let ids = j.media.map(m => m.uri).filter(m => {
                         if(this.config.allow_video_posts == true) {