emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.58k stars 413 forks source link

Crash from FrameDisconnect, Index out of range #452

Closed jimbengtsson92 closed 2 years ago

jimbengtsson92 commented 2 years ago

CocoaMQTT version: 2.0.2 iOS version: 15.4.0 Phone model: iPhone 13 Pro (Simulator)

After looking at the code (last image) it looks like checking that the array is not empty before getting the value from the array should do the trick.

Screenshot 2022-04-25 at 13 42 02

Screenshot 2022-04-25 at 13 42 18

Screenshot 2022-04-25 at 13 49 21

leeway1208 commented 2 years ago

Hi . Thanks for the report. I will fix it right now.