Added null check in generateStackTrace

The stack returned can be null which can cause an error when stack.map
is performed.
Merge pull request #17 from austhomp/master

Added null check in generateStackTrace