[hotfix] tonumber makes an empty string nil

pull/4301/head v2018.11.1
Frans de Jonge 6 years ago
parent bdb81c72f1
commit e636a0b231

@ -29,9 +29,9 @@ function Version:getNormalizedVersion(rev)
if not rev then return end
local year, month, revision = rev:match("v(%d%d%d%d)%.(%d%d)-?(%d*)")
if type(year) ~= "number" then revision = 0 end
if type(month) ~= "number" then revision = 0 end
if type(revision) ~= "number" then revision = 0 end
year = tonumber(year)
month = tonumber(month)
revision = tonumber(revision)
local commit = rev:match("-%d*-g(%x*)[%d_%-]*")
-- NOTE: * 10000 to handle at most 9999 commits since last tag ;).

Loading…
Cancel
Save