Adds another null check in scanStack

This really should fix all of the null pointer exceptions (#6 and #7).