Replaces StoreApp.setVersions() preconditionFailure with runtime error

It’s more common than expected for apps to not have any app versions, so better to fail gracefully than crash.
This commit is contained in:
Riley Testut
2022-11-23 19:08:31 -06:00
committed by Magesh K
parent 2a7926539f
commit 8f1a91df1b
4 changed files with 96 additions and 13 deletions

View File

@@ -210,8 +210,13 @@ private extension NewsViewController
throw error
}
}
catch
catch var error as NSError
{
if error.localizedTitle == nil
{
error = error.withLocalizedTitle(NSLocalizedString("Unable to Refresh Store", comment: ""))
}
DispatchQueue.main.async {
if self.dataSource.itemCount > 0
{