#vulnerable code 
                             private void writeSpecRunnerToSourceSpecDirectory() throws IOException {
		Set<String> scripts = relativizesASetOfScripts.relativize(jasmineTargetDir, resolvesCompleteListOfScriptLocations.resolve(sources, specs, preloadSources));
		
		SpecRunnerHtmlGenerator htmlGenerator = new SpecRunnerHtmlGenerator(scripts, sourceEncoding);
		String runner = htmlGenerator.generate(ReporterType.TrivialReporter, customRunnerTemplate);
		
		File destination = new File(jasmineTargetDir,manualSpecRunnerHtmlFileName);
		String existingRunner = loadExistingManualRunner(destination);
		
		if(!StringUtils.equals(runner, existingRunner)) {
			fileUtilsWrapper.writeStringToFile(destination, runner, sourceEncoding);
		} else {
			getLog().info("Skipping spec runner generation, because an identical spec runner already exists.");
		}
	} 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             private void writeSpecRunnerToSourceSpecDirectory() throws IOException {
		File runnerDestination = new File(jasmineTargetDir,manualSpecRunnerHtmlFileName);
		
		String newRunnerHtml = new SpecRunnerHtmlGenerator(scriptsForRunner(), sourceEncoding).generate(ReporterType.TrivialReporter, customRunnerTemplate);
		if(newRunnerDiffersFromOldRunner(runnerDestination, newRunnerHtml)) {
			saveRunner(runnerDestination, newRunnerHtml);
		} else {
			getLog().info("Skipping spec runner generation, because an identical spec runner already exists.");
		}
	}