#vulnerable code 
                                public TemplateEngine getTemplateEngine() {
        if (templateEngine == null) {
            TemplateEngine engine = ServiceLocator.locate(TemplateEngine.class);
            setTemplateEngine(engine);
        }

        return templateEngine;
    } 
                            #location 4 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public TemplateEngine getTemplateEngine() {
        return templateEngine;
    }