Adds another null check in scanStack

This really should fix all of the null pointer exceptions.