Skip to content

Commit

Permalink
Fixed the crash when ownerVC is nil. (#436)
Browse files Browse the repository at this point in the history
`ownerVC` should be checked in the completion as well.
  • Loading branch information
nickcheng authored Jan 20, 2021
1 parent d55f9a0 commit 9fbb7df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,8 @@ class Core: NSObject, UIGestureRecognizerDelegate {
ownerVC.notifyDidMove()
},
completion: { [weak self] in
guard let self = self else { return }
guard let self = self,
self.ownerVC != nil else { return }
self.layoutAdapter.activateLayout(for: targetPosition, forceLayout: true)
completion()
})
Expand Down

0 comments on commit 9fbb7df

Please sign in to comment.