jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/333303 )

Change subject: Fallback to mw:Error for missing images
......................................................................


Fallback to mw:Error for missing images

 * Don't rely on imageinfo being absent.

Change-Id: Id43767fbe5fc4ef69a47ebc83b32320d9a32e9b4
---
M lib/wt2html/tt/LinkHandler.js
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Subramanya Sastry: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/wt2html/tt/LinkHandler.js b/lib/wt2html/tt/LinkHandler.js
index 52cb947..5f02fc2 100644
--- a/lib/wt2html/tt/LinkHandler.js
+++ b/lib/wt2html/tt/LinkHandler.js
@@ -965,10 +965,12 @@
                        var ns = data.imgns;
                        // title is guaranteed to be not null here
                        image = data.pages[ns + ':' + title.getKey()];
-                       if (image && image.imageinfo && image.imageinfo[0]) {
-                               info = image.imageinfo[0];
-                       } else {
+                       if (!image || !image.imageinfo || !image.imageinfo[0] ||
+                                       // Fallback to adding mw:Error
+                                       image.missing !== undefined) {
                                info = false;
+                       } else {
+                               info = image.imageinfo[0];
                        }
                }
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/333303
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id43767fbe5fc4ef69a47ebc83b32320d9a32e9b4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>
Gerrit-Reviewer: Arlolra <abrea...@wikimedia.org>
Gerrit-Reviewer: C. Scott Ananian <canan...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to