fix possible NPE in generated code