mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
Check for empty response
In combination with other gadgets the error TypeError: re.query is undefined can occur because the request contains titles:'' and the response is []. Change-Id: I46d02e7c48a55cd9af20fd7ef729b4d26f69a8c0
This commit is contained in:
parent
0192822522
commit
58be4ea1de
|
@ -33,7 +33,7 @@
|
|||
var
|
||||
href = link.attr( 'href' ),
|
||||
title = link.data( 'title' ),
|
||||
deferred = $.Deferred();
|
||||
deferred = $.Deferred();
|
||||
|
||||
mw.popups.render.currentRequest = mw.popups.api.get( {
|
||||
action: 'query',
|
||||
|
@ -57,6 +57,7 @@
|
|||
mw.popups.render.currentRequest = undefined;
|
||||
|
||||
if (
|
||||
!re.query ||
|
||||
!re.query.pages ||
|
||||
!re.query.pages[ re.query.pageids[ 0 ] ].extract ||
|
||||
re.query.pages[ re.query.pageids[ 0 ] ].extract === ''
|
||||
|
|
Loading…
Reference in a new issue