Passing illegal arguments to DateTime.fromIsoDate causes a crash

When testing out the new DateTime.fromIsoDate, I discovered that passing certain arguments would always yield a crash.

Passing nothing, a string, or a number will all work. (even if they return nil)

But anything else, nil, a boolean, a function, a thread, a table, or a userdata will cause roblox to crash.

Example code:

DateTime.fromIsoDate{}

Version:
image

1 Like

For anyone interested in why this happens:

The crash is the result of a null pointer access on the result of lua_tolstring which returns null if the value isn’t a string or number.

4 Likes