#fixed code
                             @Override
	public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, final BuildListener listener) throws InterruptedException, IOException {
		AbstractProject<?, ?> project = build.getProject();
		if (build.getResult().isWorseThan(Result.SUCCESS)) {
			logger.log(Level.INFO, "Build did not succeed, merge will not be run");
			return true;
		}
		
		trigger = GhprbTrigger.extractTrigger(project);
		if (trigger == null) return false;
				
		cause = getCause(build);
		if (cause == null) {
			return true;
		}
				
		ConcurrentMap<Integer, GhprbPullRequest> pulls = trigger.getDescriptor().getPullRequests(project.getName()); 

		
		pr = pulls.get(cause.getPullID()).getPullRequest();
		
		if (pr == null) {
			logger.log(Level.INFO, "Pull request is null for ID: " + cause.getPullID());
			return false;
		}
		
		Boolean isMergeable = cause.isMerged();

		helper = new Ghprb(project, trigger, pulls);
		helper.init();
		
		if (isMergeable == null || !isMergeable) {
			logger.log(Level.INFO, "Pull request cannot be automerged, moving on.");
	    	commentOnRequest("Pull request is not mergeable.");
			return true;
		}
		
		
		GHUser triggerSender = cause.getTriggerSender();
		
		boolean merge = true;
		

		if (isOnlyAdminsMerge() && !helper.isAdmin(triggerSender.getLogin())){
			merge = false;
			logger.log(Level.INFO, "Only admins can merge this pull request, {0} is not an admin.", 
					new Object[]{triggerSender.getLogin()});
	    	commentOnRequest(
	    			String.format("Code not merged because %s is not in the Admin list.", 
	    					triggerSender.getName()));
		}
		
		if (isOnlyTriggerPhrase() && !helper.isTriggerPhrase(cause.getCommentBody())) {
			merge = false;
			logger.log(Level.INFO, "The comment does not contain the required trigger phrase.");

	    	commentOnRequest(
	    			String.format("Please comment with '%s' to automerge this request", 
	    					trigger.getTriggerPhrase()));
		}
		
	    if (isDisallowOwnCode() && isOwnCode(pr, triggerSender)) {
			merge = false;
			logger.log(Level.INFO, "The commentor is also one of the contributors.");
	    	commentOnRequest(
	    			String.format("Code not merged because %s has committed code in the request.", 
	    					triggerSender.getName()));
	    }
	    
	    if (merge) {
	    	logger.log(Level.INFO, "Merging the pull request");

			pr.merge(getMergeComment());
	    	logger.log(Level.INFO, "Pull request successfully merged");
//	    	deleteBranch(); //TODO: Update so it also deletes the branch being pulled from.  probably make it an option.
	    }
		
		return merge;
	}
#vulnerable code 
                             @Override
	public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, final BuildListener listener) throws InterruptedException, IOException {
		AbstractProject<?, ?> project = build.getProject();
		if (build.getResult().isWorseThan(Result.SUCCESS)) {
			logger.log(Level.INFO, "Build did not succeed, merge will not be run");
			return true;
		}
		
		trigger = GhprbTrigger.extractTrigger(project);
		if (trigger == null) return false;
		
		ConcurrentMap<Integer, GhprbPullRequest> pulls = trigger.getDescriptor().getPullRequests(project.getName()); 
		
		helper = new Ghprb(project, trigger, pulls);
		helper.getRepository().init();
		
		cause = getCause(build);
		if (cause == null) {
			return true;
		}
		pr = helper.getRepository().getPullRequest(cause.getPullID());
		
		if (pr == null) {
			logger.log(Level.INFO, "Pull request is null for ID: " + cause.getPullID());
			return false;
		}
		
		Boolean isMergeable = pr.getMergeable();
		int counter = 0;
		while (counter++ < 15) {
			if (isMergeable != null) {
				break;
			}
			try {
				logger.log(Level.INFO, "Waiting for github to settle so we can check if the PR is mergeable.");
				Thread.sleep(1000);
			} catch (Exception e) {
				
			}
			isMergeable = pr.getMergeable();
		}
		
		if (isMergeable == null || isMergeable) {
			logger.log(Level.INFO, "Pull request cannot be automerged, moving on.");
	    	commentOnRequest("Pull request is not mergeable.");
			return true;
		}
		
		GHUser commentor = cause.getTriggerSender();
		
		boolean merge = true;
		

		if (isOnlyAdminsMerge() && !helper.isAdmin(commentor.getLogin())){
			merge = false;
			logger.log(Level.INFO, "Only admins can merge this pull request, {0} is not an admin.", 
					new Object[]{commentor.getLogin()});
	    	commentOnRequest(
	    			String.format("Code not merged because %s is not in the Admin list.", 
	    					commentor.getName()));
		}
		
		if (isOnlyTriggerPhrase() && !helper.isTriggerPhrase(cause.getCommentBody())) {
			merge = false;
			logger.log(Level.INFO, "The comment does not contain the required trigger phrase.");

	    	commentOnRequest(
	    			String.format("Please comment with '%s' to automerge this request", 
	    					trigger.getTriggerPhrase()));
	    	return true;
		}
		
	    if (isDisallowOwnCode() && isOwnCode(pr, commentor)) {
			merge = false;
			logger.log(Level.INFO, "The commentor is also one of the contributors.");
	    	commentOnRequest(
	    			String.format("Code not merged because %s has committed code in the request.", 
	    					commentor.getName()));
	    }
	    
	    if (merge) {
	    	logger.log(Level.INFO, "Merging the pull request");
	    	pr.merge(getMergeComment());
//	    	deleteBranch(); //TODO: Update so it also deletes the branch being pulled from.  probably make it an option.
	    }
		
		return merge;
	} 
                            #location 15 
                            #vulnerability type NULL_DEREFERENCE