[iOS] Fixed crash in carplay

This commit is contained in:
Alexander Boriskov 2020-10-06 12:26:28 +03:00 committed by Aleksey Belousov
parent 1459a2d5ee
commit 8cf76b35a5

View file

@ -367,8 +367,10 @@ extension CarPlayService: CPMapTemplateDelegate {
}
MapTemplateBuilder.configureNavigationUI(mapTemplate: rootMapTemplate)
interfaceController.popToRootTemplate(animated: false)
if interfaceController.templates.count > 1 {
interfaceController.popToRootTemplate(animated: false)
}
router.startNavigationSession(forTrip: trip, template: rootMapTemplate)
router.startRoute()
if let estimates = createEstimates(routeInfo: info) {
@ -617,7 +619,10 @@ extension CarPlayService {
let mapTemplate = MapTemplateBuilder.buildTripPreviewTemplate(forTrips: trips)
if let interfaceController = interfaceController {
mapTemplate.mapDelegate = self
interfaceController.popToRootTemplate(animated: false)
if interfaceController.templates.count > 1 {
interfaceController.popToRootTemplate(animated: false)
}
interfaceController.pushTemplate(mapTemplate, animated: false)
}
}