Skip to content

Commit

Permalink
Fix crash when the sync state was collected by the activity before an…
Browse files Browse the repository at this point in the history
…y possible fragments were attached
  • Loading branch information
sictiru committed May 14, 2024
1 parent ff7671c commit 3e9d452
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ open class NbActivity : AppCompatActivity() {

// Facilitates the db updates by the sync service on the UI
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.CREATED) {
repeatOnLifecycle(Lifecycle.State.STARTED) {
launch {
NbSyncManager.state.collectLatest {
withContext(Dispatchers.Main) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public void scrollToPosition(int position) {
}

protected FeedSet getFeedSet() {
return ((ItemsList) getActivity()).getFeedSet();
return ((ItemsList) requireActivity()).getFeedSet();
}

public void hasUpdated() {
Expand Down

0 comments on commit 3e9d452

Please sign in to comment.