Skip to content

Commit

Permalink
Add null handling to getOptionsFromEntityData
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed Feb 28, 2025
1 parent fef1052 commit e7445d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resources/ext.wikibase.export.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ $( function () {
* @return {{data: *, label: *}[]}
*/
getOptionsFromEntityData: function ( data ) {
if ( !data || !data.entities ) {
return [];
}

return Object.keys( data.entities ).map(
( key ) => this.getOptionFromEntity( data.entities[ key ] )
);
Expand Down

0 comments on commit e7445d5

Please sign in to comment.