#vulnerable code 
                             public boolean cancelBuild(int id) {
		if(queuedBuilds.containsKey(id)){
			try {
				Run<?,?> build = (Run) queuedBuilds.get(id).waitForStart();
				if(build.getExecutor() == null) return false;
				build.getExecutor().interrupt();
				queuedBuilds.remove(id);
				return true;
			} catch (Exception ex) {
				Logger.getLogger(GhprbRepo.class.getName()).log(Level.WARNING, null, ex);
				return false;
			}
		}else if(runningBuilds.containsKey(id)){
			try {
				Run<?,?> build = (Run) runningBuilds.get(id).waitForStart();
				if(build.getExecutor() == null) return false;
				build.getExecutor().interrupt();
				runningBuilds.remove(id);
				return true;
			} catch (Exception ex) {
				Logger.getLogger(GhprbRepo.class.getName()).log(Level.WARNING, null, ex);
				return false;
			}
		}else{
			return false;
		}
	} 
                            #location 4 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public boolean cancelBuild(int id) {
		Iterator<GhprbBuild> it = builds.iterator();
		while(it.hasNext()){
			GhprbBuild build  = it.next();
			if (build.getPullID() == id) {
				if (build.cancel()) {
					it.remove();
					return true;
				}
			}
		}
		return false;
	}