Fix state compiler stack trace, github issue #5767
Merge pull request #7931 from cro/develop

Fix state compiler stack trace, github issue #5767