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

When a time is set on SunTime, it should not emit an event on Start #1

Open
mvriel opened this issue Aug 7, 2023 · 0 comments
Open

Comments

@mvriel
Copy link
Contributor

mvriel commented Aug 7, 2023

On https://github.com/Netherlands3D/Sun/blob/main/Runtime/Scripts/SunTime.cs#L64, the Apply method is called and will think the time has changed and thus emit an event. This can cause an exception NullReferenceException: Object reference not set to an instance of an object DateTimeExtract.ExtractFromDateTime (System.DateTime dateTime) because other parts of the application their Start's haven't completed yet.

The fix for this is to only emit an event for when the time has changed if it really has; and not upon initialisation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant