From cff96b8a4760365a524be438e31d523f9fcba998 Mon Sep 17 00:00:00 2001 From: mukherr <93953604+mukherr@users.noreply.github.com> Date: Mon, 8 Nov 2021 15:35:29 -0800 Subject: [PATCH] Update client.py --- .../AWSIoTPythonSDK/core/protocol/paho/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.')