Search Unity

Getting the stack trace from a caught exception?

Discussion in 'Android' started by cory_munky, Feb 4, 2016.

  1. cory_munky

    cory_munky

    Joined:
    Dec 10, 2014
    Posts:
    66
    We are catching and logging some Null Reference exceptions in our game, but the exception.StackTrace is turning out to be an empty string.

    Is this expected? Is there any way to get a trace of the point of the null reference?
    Unity 5.3.2p1, Android, IL2CPP

    Thanks!
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    You can try to use the StackTraceUtility class to create a new StackTrace for the current location (maybe this will also fail for your scenario, but you can try it out).