diff --git a/aws-iot-device-sdk-python-master/AWSIoTPythonSDK/core/protocol/paho/client.py b/aws-iot-device-sdk-python-master/AWSIoTPythonSDK/core/protocol/paho/client.py index 503d1c6..f68676c 100755 --- a/aws-iot-device-sdk-python-master/AWSIoTPythonSDK/core/protocol/paho/client.py +++ b/aws-iot-device-sdk-python-master/AWSIoTPythonSDK/core/protocol/paho/client.py @@ -940,7 +940,7 @@ def publish(self, topic, payload=None, qos=0, retain=False): A ValueError will be raised if topic is None, has zero length or is invalid (contains a wildcard), if qos is not one of 0, 1 or 2, or if the length of the payload is greater than 268435455 bytes.""" - if topic is None or len(topic) == 0: + if topic is None or not topic: raise ValueError('Invalid topic.') if qos<0 or qos>2: raise ValueError('Invalid QoS level.')