Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Asynchronus Load throwing error Release v1.22 #43

Closed
Zeneroth opened this issue Oct 2, 2018 · 2 comments
Closed

Asynchronus Load throwing error Release v1.22 #43

Zeneroth opened this issue Oct 2, 2018 · 2 comments
Labels
Milestone

Comments

@Zeneroth
Copy link

Zeneroth commented Oct 2, 2018

I download the new release v1.22 to check out the new LoadAsync.
Then I tried using the new Async load as follows

context.Parse(path);
context.LoadAsync(onLoaded, onError, false);

And got some error like this

NullReferenceException: Object reference not set to an instance of an object
DepthFirstScheduler.Schedulable`1[T].OnExecute (DepthFirstScheduler.IScheduler scheduler, System.Action`1[T] pred) (at Assets/UniGLTF/DepthFirstScheduler/Schedulable.cs:155)
UniGLTF.ImporterContext.LoadAsync (System.Boolean show) (at Assets/UniGLTF/Core/Scripts/IO/ImporterContext.cs:469)
UniGLTF.ImporterContext.LoadAsync (System.Action`1[T] onLoaded, System.Action`1[T] onError, System.Boolean show) (at Assets/UniGLTF/Core/Scripts/IO/ImporterContext.cs:452)

I have traced this back to this line in Schedulable.cs

Parent.AddChild(schedulable);

and it seems that Parent is null. I'm not quite sure if this is from me using the LoadAsync incorrectly without proper setup or there is something I'm missing? Thanks in advance for the advise.

@ousttrue ousttrue added the bug label Oct 2, 2018
@ousttrue ousttrue added this to the 1.23 milestone Oct 2, 2018
@ousttrue
Copy link
Owner

ousttrue commented Oct 2, 2018

Thank you for your feedback.

This is bug. Schedulable require AddTask() before OnExecute().
I fixed it.

ef42257#diff-37f6edcd531537fb48bf880cd76e8750R515

Please use v1.23.

@Zeneroth
Copy link
Author

Zeneroth commented Oct 3, 2018

Awesome I just tested it out and now working correctly!

@Zeneroth Zeneroth closed this as completed Oct 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants