Skip to content

Commit 237373f

Browse files
authored
Merge pull request #47 from 2bndy5/master
payload parameter of type `None` replaced with zero-length string in `will_set()`
2 parents 1adb75d + 95f9519 commit 237373f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def will_set(self, topic=None, payload=None, qos=0, retain=False):
217217
if self._is_connected:
218218
raise MMQTTException("Last Will should only be called before connect().")
219219
if payload is None:
220-
raise MMQTTException("Message can not be None.")
220+
payload = ""
221221
if isinstance(payload, (int, float, str)):
222222
payload = str(payload).encode()
223223
else:

0 commit comments

Comments
 (0)