Closed djbr-david closed 6 years ago
Thanks for raising this issue @djbr-david, I've put a check in that will only attempt to close the Persistence layer if the hashtable has been initialised, I've also ported some improvements that are in the v5 client that throw an MqttPersistenceException
when putting or getting if the persistence hasn't been initialised, so that should get rid of any null pointers would would have otherwise seen too.
Many thanks for your time and effort.
Please fill out the form below before submitting, thank you!
If this is a bug regarding the Android Service, please raise the bug here instead: https://github.com/eclipse/paho.mqtt.android/issues/new
Using Memory Persistence and am getting the above exception when calling the close method, but other methods could suffer the same issue. The setup code is:
which generally works fine, but if the MqttClient fails to initialise, the persistence open method wont be called so later on when I try to call the close method as part of my disconnect handling it fails. Checking the File Persistence code, I see this situation is handled correctly, so for consistency Memory Persistence should exhibit the same behaviour which then means client code doesn't need to change if the underlying Persistence mechanism changes.