Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in discussions #264

Merged
merged 3 commits into from
Apr 4, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make step field in DiscussionsViewController optional
kvld committed Apr 3, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 55feb759becf7856789c9a5d47f1784246ca7363
6 changes: 4 additions & 2 deletions Stepic/DiscussionsViewController.swift
Original file line number Diff line number Diff line change
@@ -42,7 +42,9 @@ class DiscussionsViewController: UIViewController {

var discussionProxyId: String!
var target: Int!
var step: Step!

// This var uses only for incrementing discussions count
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This var is used

var step: Step?

@IBOutlet weak var tableView: UITableView!

@@ -725,7 +727,7 @@ extension DiscussionsViewController : WriteCommentDelegate {
discussionIds.loaded.insert(comment.id, at: 0)
discussions.insert(comment, at: 0)
reloadTableData()
step.discussionsCount? += 1
step?.discussionsCount? += 1
}
}
}