Content deleted Content added
protect against empty strings |
better error handling |
||
Line 264:
local n=n*pr+100000.0*(4.0-math.floor(T1/5.0))
return IrishEN2LL(e,n)
end▼
local function empty(s)▼
return s == nil or s == ''▼
end
Line 269 ⟶ 273:
-- returns a country,error,lat,long list
ngr = mw.ustring.gsub(mw.ustring.upper(ngr),"[^%d%u]","")
local first, last, lett, num = mw.ustring.
return nil,"Malformed NGR",0.0,0.0▼
end▼
if mw.ustring.len(lett) == 1 then
return Irish2LL(lett,num)
end
▲ end
▲ return nil,"Malformed NGR",0.0,0.0
end
Line 309 ⟶ 312:
end
return html
▲end
▲local function empty(s)
▲ return s == nil or s == ''
end
|