fix possible npe case in twig block goto #397