fix NPE on MethodFormat.getCodeSource suggest by @brasmusson

This fix same issue of PR: https://github.com/cucumber/cucumber-jvm/pull/751

@brasmusson suggest this approach and here is code.