Fix OsTimeModule.clock returning nil at application start
@@ -35,7 +35,9 @@ namespace MoonSharp.Interpreter.CoreLib
[MoonSharpModuleMethod]
public static DynValue clock(ScriptExecutionContext executionContext, CallbackArguments args)
{
- return GetUnixTime(DateTime.UtcNow, Time0);
+ var t = GetUnixTime(DateTime.UtcNow, Time0);
+ if (t.IsNil()) return DynValue.NewNumber(0.0);
+ return t;
}