Search Unity

Couldn't extract exception string from exception of type StackOverflowException

Discussion in 'Scripting' started by ElnuDev, Feb 15, 2019.

  1. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    I'm getting this bizarre error in my console:

    Code (CSharp):
    1. Couldn't extract exception string from exception of type StackOverflowException (another exception of class 'NullReferenceException' was thrown while processing the stack trace)
    Another strange thing is that directly after that error is another error, which is completely blank.

    Any ideas what this is, what caused it, and how it can be fixed? I tried restarting Unity but that didn't fix anything.
     
  2. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,836
    Well, whatever is going on, it sounds like it involves a StackOverflowException. The most common cause of that would be an infinitely-recursive function; have you written any recursive functions that might have a missing or incorrect base case?
     
    ElnuDev likes this.
  3. ElnuDev

    ElnuDev

    Joined:
    Sep 24, 2017
    Posts:
    298
    Yup, that's it. Thanks so much! I accidentally wrote the wrong function name and made the function infinitely call itself. :rolleyes: