diff options
author | Aitor Cereceto <cereender@gmail.com> | 2021-03-12 08:12:43 +0100 |
---|---|---|
committer | Aitor Cereceto <cereender@gmail.com> | 2021-03-12 09:27:21 +0100 |
commit | 1e820b3d9db58b6d72ad3ba227cd5e401893c72a (patch) | |
tree | b19f0bdf385858e5f9d8e1b65315225578edf652 /core/core_bind.cpp | |
parent | 27dea9366f0ab0229bc52a39ce701a46d107020b (diff) | |
download | redot-engine-1e820b3d9db58b6d72ad3ba227cd5e401893c72a.tar.gz |
[46188] fix: get unix from datetime when empty dict
Diffstat (limited to 'core/core_bind.cpp')
-rw-r--r-- | core/core_bind.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index e7a77384da..2d6b8e5666 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -373,6 +373,9 @@ Dictionary _OS::get_time(bool utc) const { * @return epoch calculated */ int64_t _OS::get_unix_time_from_datetime(Dictionary datetime) const { + // if datetime is an empty Dictionary throws an error + ERR_FAIL_COND_V_MSG(datetime.is_empty(), 0, "Invalid datetime Dictionary: Dictionary is empty"); + // Bunch of conversion constants static const unsigned int SECONDS_PER_MINUTE = 60; static const unsigned int MINUTES_PER_HOUR = 60; |