sur950 / any_link_preview

A flutter Plugin/Package to show the preview of any web link that starts with HTTP/HTTPS. Mostly useful for application that had chat.
MIT License
70 stars 70 forks source link

Error in CacheManager.getJson(String key) #52

Closed zhouyuePi closed 1 year ago

zhouyuePi commented 1 year ago

See code at line #8 and #9: dynamic cache = sharedPreferences.getString(key); var jsonMapCache = jsonDecode(cache) as Map<dynamic, dynamic>; Line #8, dynamic cache = sharedPreferences.getString(key);, sometimes returns null, which cause error at line 9 when it tries to jsonDecode an empty String. Please add null check around line #9.

sur950 commented 1 year ago

Hi @zhouyuePi

Thanks for bringing it to my notice. This is a duplicate of #48

However, I made a fix and will be out in the next release i.e., 3.0.1