summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/custom_layer_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/layers/custom_layer_impl.cpp')
-rw-r--r--src/mbgl/style/layers/custom_layer_impl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mbgl/style/layers/custom_layer_impl.cpp b/src/mbgl/style/layers/custom_layer_impl.cpp
index 3fdeb156a2..97a7bba78f 100644
--- a/src/mbgl/style/layers/custom_layer_impl.cpp
+++ b/src/mbgl/style/layers/custom_layer_impl.cpp
@@ -14,6 +14,9 @@ CustomLayer::Impl::Impl(const std::string& id_,
}
void CustomLayer::Impl::didSetObserver(bool didSet) const {
+ if (!context)
+ return;
+
if (didSet) {
context->attach();
}