Skip to content

Commit

Permalink
Add preventive check in style observer.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximAlien committed Aug 18, 2020
1 parent d31b632 commit 5d4b6bf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions MapboxNavigation/NavigationMapView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ open class NavigationMapView: MGLMapView, UIGestureRecognizerDelegate {
installUserCourseView()

styleObservation = observe(\.style, options: .new) { [weak self] (mapView, change) in
guard change.newValue != nil else { return }
guard let self = self else { return }

if let routes = self.routes, let currentRoute = routes.first {
Expand Down

0 comments on commit 5d4b6bf

Please sign in to comment.