Module:Video game wikidata: Difference between revisions

Content deleted Content added
No edit summary
Avoid Lua errors when Wikidata is unavailable (e.g. on other MediaWikis)
Line 352:
-- Check for a game parameter. If missing, default to current article.
if(iGame ~= nil and iGame ~= "") then
if(entities[iGame] == nil and mw.wikibase ~= nil) then
entities[iGame] = mw.wikibase.getEntity(iGame);
end;
Line 359:
else
-- Need to research if we can determine the entity's ID before retrieving it.
entity = if(mw.wikibase.getEntity( ~= nil); then
if( entity ~= nilmw.wikibase.getEntity() then;
entities[if(entity['id']] ~= entity;nil) then
entities[entity['id']] = entity;
end;
end;
end;