Module:Coordinates: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(add Wikidata tracking categories per protected edit request by User:Multichill at Template talk:Coord#Wikidata tracking; also convert whitespace to tabs)
(check for nil values of entity.claims per protected edit request by User:Hydrox)
Line 594: Line 594:
if valid_Display and mw.wikibase and current_page.namespace == 0 then -- add the appropriate Wikidata category for main namespace pages
if valid_Display and mw.wikibase and current_page.namespace == 0 then -- add the appropriate Wikidata category for main namespace pages
local entity = mw.wikibase.getEntity()
local entity = mw.wikibase.getEntity()
if entity and entity.claims.p625 then
if entity and entity.claims and entity.claims.p625 then
local snaktype = entity.claims.p625[0].mainsnak.snaktype
local snaktype = entity.claims.p625[0].mainsnak.snaktype
if snaktype == 'value' then
if snaktype == 'value' then