From: Matthew Flaschen Date: Thu, 4 Jun 2015 19:02:31 +0000 (-0400) Subject: Handle no pageids response field in MessagePoster factory X-Git-Tag: 1.31.0-rc.0~10839^2 X-Git-Url: http://git.cyclocoop.org/%27.%28%24current%20%3E%202?a=commitdiff_plain;h=a96073239d25817719002b59a72f03865c0f554b;p=lhc%2Fweb%2Fwiklou.git Handle no pageids response field in MessagePoster factory This can happen for interwiki; we should at least reject properly instead of dereferencing undefined. Change-Id: I6cfb92e0dc9c74ff10e0be0738fbe5ea65da9f42 --- diff --git a/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js b/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js index 9d280800bd..ec14f8ba7a 100644 --- a/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js +++ b/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js @@ -67,7 +67,7 @@ indexpageids: 1, titles: title.getPrefixedDb() } ).then( function ( result ) { - if ( result.query.pageids.length > 0 ) { + if ( result.query.pageids && result.query.pageids.length > 0 ) { pageId = result.query.pageids[0]; page = result.query.pages[pageId];