#vulnerable code 
                             @SuppressWarnings({ "rawtypes" })
	public void runner(String pack) throws Exception {
		File f = new File(System.getProperty("user.dir") + "/target/appiumlogs/");
		if (!f.exists()) {
			System.out.println("creating directory: " + "Logs");
			boolean result = false;
			try {
				f.mkdir();
				result = true;
			} catch (SecurityException se) {
				// handle it
			}
			if (result) {
				System.out.println("DIR created");
			}
		}

		File adb_logs = new File(System.getProperty("user.dir") + "/target/adblogs/");
		if (!adb_logs.exists()) {
			System.out.println("creating directory: " + "ADBLogs");
			boolean result = false;
			try {
				adb_logs.mkdir();
				result = true;
			} catch (SecurityException se) {
				// handle it
			}
			if (result) {
				System.out.println("DIR created");
			}
		}
		input = new FileInputStream("config.properties");
		prop.load(input);
		
		if(deviceConf.getDevices() != null){
			devices = deviceConf.getDevices();
			deviceCount = devices.size() / 3;
		} else if (prop.getProperty("PLATFORM").equalsIgnoreCase("ios")) {
			deviceCount=iosDevice.getIOSUDID().size();		
		}
		if(iosDevice.getIOSUDID() != null){
			deviceCount += iosDevice.getIOSUDID().size();
		}
		
		createSnapshotFolder(deviceCount);
		System.out.println("Total Number of devices detected::" + deviceCount);
		System.out.println("starting running tests in threads");

		testcases = new ArrayList<Class>();

		// final String pack = "com.paralle.tests"; // Or any other package
		PackageUtil.getClasses(pack).stream().forEach(s -> {
			if (s.toString().contains("Test")) {
				System.out.println("forEach: " + testcases.add((Class) s));
			}
		});

		//TODO: Add another check for OS on distribution and parallel
		if (prop.getProperty("RUNNER").equalsIgnoreCase("distribute")) {
			//myTestExecutor.distributeTests(deviceCount, testcases);
			myTestExecutor.runMethodParallelAppium(pack, deviceCount,"distribute");

		}//TODO: Add another check for OS on distribution and parallel
		else if (prop.getProperty("RUNNER").equalsIgnoreCase("parallel")) {
			myTestExecutor.runMethodParallelAppium(pack, deviceCount,"parallel");
		}

	} 
                            #location 39 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @SuppressWarnings({ "rawtypes" })
	public void runner(String pack) throws Exception {
		File f = new File(System.getProperty("user.dir") + "/target/appiumlogs/");
		if (!f.exists()) {
			System.out.println("creating directory: " + "Logs");
			boolean result = false;
			try {
				f.mkdir();
				result = true;
			} catch (SecurityException se) {
				// handle it
			}
			if (result) {
				System.out.println("DIR created");
			}
		}

		File adb_logs = new File(System.getProperty("user.dir") + "/target/adblogs/");
		if (!adb_logs.exists()) {
			System.out.println("creating directory: " + "ADBLogs");
			boolean result = false;
			try {
				adb_logs.mkdir();
				result = true;
			} catch (SecurityException se) {
				// handle it
			}
			if (result) {
				System.out.println("DIR created");
			}
		}
		input = new FileInputStream("config.properties");
		prop.load(input);
		
		if(deviceConf.getDevices() != null){
			devices = deviceConf.getDevices();
			deviceCount = devices.size() / 3;
		} 
		if(iosDevice.getIOSUDID() != null){
			deviceCount += iosDevice.getIOSUDID().size();
		}
		
		createSnapshotFolder(deviceCount);
		System.out.println("Total Number of devices detected::" + deviceCount);
		System.out.println("starting running tests in threads");

		testcases = new ArrayList<Class>();

		// final String pack = "com.paralle.tests"; // Or any other package
		PackageUtil.getClasses(pack).stream().forEach(s -> {
			if (s.toString().contains("Test")) {
				System.out.println("forEach: " + testcases.add((Class) s));
			}
		});

		//TODO: Add another check for OS on distribution and parallel
		if (prop.getProperty("RUNNER").equalsIgnoreCase("distribute")) {
			//myTestExecutor.distributeTests(deviceCount, testcases);
			myTestExecutor.runMethodParallelAppium(pack, deviceCount,"distribute");

		}//TODO: Add another check for OS on distribution and parallel
		else if (prop.getProperty("RUNNER").equalsIgnoreCase("parallel")) {
			myTestExecutor.runMethodParallelAppium(pack, deviceCount,"parallel");
		}

	}