Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Exception not checked #48

Closed
francisnnumbi opened this issue Jul 11, 2021 · 4 comments
Closed

Exception not checked #48

francisnnumbi opened this issue Jul 11, 2021 · 4 comments

Comments

@francisnnumbi
Copy link

I have currently tested the lib. but you did not provide exception checker on these two methods :

  • _getiOSStoreVersion()
  • _getAndroidStoreVersion()

I would have branched the changes I did on my forked project, but I'm not able !
Just adding try...catch to returned values:

FOR IOS: _getiOSStoreVersion()
try { return VersionStatus._( localVersion: packageInfo.version, storeVersion: jsonObj['results'][0]['version'], appStoreLink: jsonObj['results'][0]['trackViewUrl'], releaseNotes: jsonObj['results'][0]['releaseNotes'], ); } catch (exc) { return null; }

FOR ANDROID: _getAndroidStoreVersion()
try { return VersionStatus._( localVersion: packageInfo.version, storeVersion: storeVersion, appStoreLink: uri.toString(), releaseNotes: releaseNotes, ); } catch (exc) { return null; }

@timtraversy
Copy link
Owner

Thanks for reporting this. Did you experience a crash, or do you just want to add extra safeguards?

@francisnnumbi
Copy link
Author

I experienced a crush. I don't have any app on appstore. So, i just put a imaginary value. It crushed. i checked your source code. I saw where it was crushing. I had to wrap it into try...catch.

@francisnnumbi
Copy link
Author

In fact, it is better to wrap from where you fetch data from the server.

@timtraversy
Copy link
Owner

Going to close this in favor of #50

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants