Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Are there any cases in that unity ignores the exception and runs the next code?

$
0
0
Hi, there. I have a question about unity error/exception that sometimes ignores.
void Awake() { /* * do something... */ // Set title text titleObject.SetTitle("..."); }
My code is just like this. Firebase crashlytics said there was a NullReferenceException in 'do something...' part and another NullRefException **inside** ```titleObject.SetTitle("...")``` **at the same time.** In my opinion, if 'do something...' part has an error or exception, Awake() should be stopped and ```titleObject.SetTitle("...")``` cannot be called. However, it was called and threw NullRefException...
Especially, ```SetTitle(string title)``` method only uses ```TextMeshProUGUI``` object that is set(dragged) in the inspector. It cannot be null. **(not prefab, not dynamically created object)** Inside the method, there is only ```titleText.text = title;``` code. (titleText is TextMeshProUGUI)
So, the question is, **Does Unity sometimes ignore an exception that was thrown first and run the next code?**
When I test in the editor, Unity stopped Awake() method, and ```titleObject.SetTitle("...")``` was not called. Same in apk build. ONLY crashlytics said NullRefException inside ```titleObject.SetTitle("...")``` .

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>