#vulnerable code 
                             @Override
	public String deviceHandler(CallItem anItem, MultiCommandUtil aMultiUtil, String lightId, int intensity, Integer targetBri, Integer targetBriInc, ColorData colorData, DeviceDescriptor device, String body) {
		log.debug("Exec Request called with url: " +  anItem.getItem().getAsString() + " and exec Garden: "  + (theSettings.getBridgeSecurity().getExecGarden() == null ? "not given" : theSettings.getBridgeSecurity().getExecGarden()));
		String responseString = null;
		String intermediate;
		if (anItem.getItem().getAsString().contains("exec://"))
			intermediate = anItem.getItem().getAsString().substring(anItem.getItem().getAsString().indexOf("://") + 3);
		else
			intermediate = anItem.getItem().getAsString();
		intermediate = BrightnessDecode.calculateReplaceIntensityValue(intermediate, intensity, targetBri, targetBriInc, false);
		if (colorData != null) {
			intermediate = ColorDecode.replaceColorData(intermediate, colorData, BrightnessDecode.calculateIntensity(intensity, targetBri, targetBriInc), false);	
		}
		intermediate = DeviceDataDecode.replaceDeviceData(intermediate, device);
		intermediate = TimeDecode.replaceTimeValue(intermediate);
		String execGarden = theSettings.getBridgeSecurity().getExecGarden();
		if(execGarden != null && !execGarden.trim().isEmpty()) {
			if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
				intermediate = execGarden + "\\" + intermediate;
			else
				intermediate = execGarden + "/" + intermediate;
		}

		String anError = doExecRequest(intermediate, lightId);
		if (anError != null) {
			responseString = anError;
		}
		return responseString;
	} 
                            #location 18 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @Override
	public String deviceHandler(CallItem anItem, MultiCommandUtil aMultiUtil, String lightId, int intensity, Integer targetBri, Integer targetBriInc, ColorData colorData, DeviceDescriptor device, String body) {
		log.debug("Exec Request called with url: " +  anItem.getItem().getAsString() + " and exec Garden: "  + (theSettings.getBridgeSecurity().getExecGarden() == null ? "not given" : theSettings.getBridgeSecurity().getExecGarden()));
		String responseString = null;
		String intermediate;
		if (anItem.getItem().getAsString().contains("exec://"))
			intermediate = anItem.getItem().getAsString().substring(anItem.getItem().getAsString().indexOf("://") + 3);
		else
			intermediate = anItem.getItem().getAsString();
		intermediate = BrightnessDecode.calculateReplaceIntensityValue(intermediate, intensity, targetBri, targetBriInc, false);
		if (colorData != null) {
			intermediate = ColorDecode.replaceColorData(intermediate, colorData, BrightnessDecode.calculateIntensity(intensity, targetBri, targetBriInc), false);	
		}
		intermediate = DeviceDataDecode.replaceDeviceData(intermediate, device);
		intermediate = TimeDecode.replaceTimeValue(intermediate);
		String execGarden = theSettings.getBridgeSecurity().getExecGarden();
		if(execGarden != null && !execGarden.trim().isEmpty()) {
			intermediate = new File(execGarden.trim(), intermediate).getAbsolutePath();
		}

		String anError = doExecRequest(intermediate, lightId);
		if (anError != null) {
			responseString = anError;
		}
		return responseString;
	}