Fix NPE in `AllMethodsTraverserImpl`

Fixes #1002217
Merge pull request #764 from sschaef/t1002217

Fix NPE in `AllMethodsTraverserImpl`