added an assertion

This commit is contained in:
Araq
2015-10-27 08:37:43 +01:00
parent ee08c6eecf
commit e94a6ec1f9

View File

@@ -439,7 +439,9 @@ when not defined(JS):
proc getTime(): Time = return timec(nil)
proc getLocalTime(t: Time): TimeInfo =
var a = t
result = tmToTimeInfo(localtime(addr(a))[], true)
let lt = localtime(addr(a))
assert(not lt.isNil)
result = tmToTimeInfo(lt[], true)
# copying is needed anyway to provide reentrancity; thus
# the conversion is not expensive