- Home /
Completion of JsonUtility deserialization before running function
How to ensure completion of deserialization of large Json file using JsonUtility before running a method which dependent on the instance of the deserialization?
If the I were to have the method run just after line of new instance creation using JsonUtility.FromJson, it always throws NullReferenceException: Object reference not set to an instance of an object, but in fact the instance is already there.
Answer by Bunny83 · Apr 21, 2019 at 04:24 PM
JsonUtility.FromJson is a synchonous blocking call. It has finished deserializing when it returns. If you get a null reference exception you probably try to deserialized something that isn't supported. What kind of object(s) do you try to deserialize? How does your json look like? Without more information we can not help you any further.
You are right! just mistake in the code of my method - which is a wrong reference!
Your answer
![](https://koobas.hobune.stream/wayback/20220612195924im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Allocating Game Object name dynamically using Find 0 Answers
Why am I getting a NullReferenceException while trying to set a gameobjects animation frame? 0 Answers
NullReferenceException .. problem with Camera.main.transform 2 Answers
Raycasting null object reference error 1 Answer
Editing in Animator removes Player tag 0 Answers