Added null or empty check for com port name