fix possible npe in annotation template collector #358