Skip to content

Commit

Permalink
Add defensive code to viewStatsForPost
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed May 4, 2024
1 parent e187759 commit 0990236
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,9 @@ class AbstractPostListViewController: UIViewController,
SiteStatsInformation.sharedInstance.oauth2Token = blog.authToken
SiteStatsInformation.sharedInstance.siteID = blog.dotComID

let postURL = URL(string: post.permaLink! as String)
guard let postURL = post.permaLink.flatMap(URL.init) else {
return wpAssertionFailure("permalink missing or invalid")
}
let postStatsTableViewController = PostStatsTableViewController.withJPBannerForBlog(postID: postID,
postTitle: post.titleForDisplay(),
postURL: postURL)
Expand Down

0 comments on commit 0990236

Please sign in to comment.