Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop on incomplete Datetime dictionary (OS.get_unix_time_from_datetime) #49022

Closed
Peda1996 opened this issue May 24, 2021 · 1 comment · Fixed by #49023
Closed

Infinite loop on incomplete Datetime dictionary (OS.get_unix_time_from_datetime) #49022

Peda1996 opened this issue May 24, 2021 · 1 comment · Fixed by #49023

Comments

@Peda1996
Copy link

Peda1996 commented May 24, 2021

The godot (v3.3.stable.official windows) engine seems to crash if you only provide a part of the dictionary:

Example:

func _ready() -> void:
	print(OS.get_unix_time_from_datetime({
		"second": 1,
	}))

Edit* No Crash log, the game just freezes

@akien-mga akien-mga added this to the 4.0 milestone May 24, 2021
@akien-mga akien-mga changed the title Godot crashes on incomplete Datetime Dict (OS.get_unix_time_from_datetime) Infinite loop on incomplete Datetime dictionary (OS.get_unix_time_from_datetime) May 24, 2021
akien-mga added a commit to akien-mga/godot that referenced this issue May 24, 2021
Default missing keys to Unix time 0 (1970-01-01 at 00:00:00 UTC).
Abort if year <= 0, this is not supported by the current algorithm.

Prevents an infinite loop further down.

Fixes godotengine#49022.
akien-mga added a commit that referenced this issue May 24, 2021
Default missing keys to Unix time 0 (1970-01-01 at 00:00:00 UTC).
Abort if year <= 0, this is not supported by the current algorithm.

Prevents an infinite loop further down.

Fixes #49022.

(cherry picked from commit 62efa30)
@Peda1996
Copy link
Author

Wow, that was damn fast :)
Thanks 👍

akien-mga added a commit to akien-mga/godot that referenced this issue May 31, 2021
Default missing keys to Unix time 0 (1970-01-01 at 00:00:00 UTC).
Abort if year <= 0, this is not supported by the current algorithm.

Prevents an infinite loop further down.

Fixes godotengine#49022.

(cherry picked from commit 62efa30)
akien-mga added a commit to akien-mga/godot that referenced this issue Jun 1, 2021
Default missing keys to Unix time 0 (1970-01-01 at 00:00:00 UTC).
Abort if year <= 0, this is not supported by the current algorithm.

Prevents an infinite loop further down.

Fixes godotengine#49022.

(cherry picked from commit 62efa30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants