Skip to content

Commit 0928212

Browse files
authored
Merge pull request adafruit#5 from brentru/fix-connack-exception
Fix CONNACK IndexError
2 parents aec4427 + de9ecb8 commit 0928212

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_minimqtt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def connect(self, clean_session=True):
279279
rc = self._sock.read(3)
280280
assert rc[0] == 0x02
281281
if rc[2] != 0x00:
282-
raise MMQTTException(CONNACK_ERRORS[rc[3]])
282+
raise MMQTTException(CONNACK_ERRORS[rc[2]])
283283
self._is_connected = True
284284
result = rc[0] & 1
285285
if self.on_connect is not None:

0 commit comments

Comments
 (0)