From d6190f55f44dc45aabfca025124061028cb65b2d Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Mon, 21 Sep 2020 13:22:03 -0700 Subject: [PATCH] Address crash when localFontFamilyName is nil (#467) --- platform/ios/src/MGLMapView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 32dd674460..8cdac08770 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -556,7 +556,7 @@ - (void)commonInit // setup mbgl map MGLRendererConfiguration *config = [MGLRendererConfiguration currentConfiguration]; - auto localFontFamilyName = config.localFontFamilyName ? std::string(config.localFontFamilyName.UTF8String) : nullptr; + mbgl::optional localFontFamilyName = config.localFontFamilyName ? mbgl::optional(std::string(config.localFontFamilyName.UTF8String)) : mbgl::nullopt; auto renderer = std::make_unique(_mbglView->getRendererBackend(), config.scaleFactor, localFontFamilyName); BOOL enableCrossSourceCollisions = !config.perSourceCollisions; _rendererFrontend = std::make_unique(std::move(renderer), self, _mbglView->getRendererBackend());