Skip to content

Commit

Permalink
Add defensive code to viewStatsForPost (#23155)
Browse files Browse the repository at this point in the history
  • Loading branch information
kean authored May 7, 2024
2 parents cd5d37f + 0990236 commit 6df31d6
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 6df31d6

Please sign in to comment.