Fail early in case there is no display

This commit is contained in:
Konstantin Käfer
2015-02-12 11:35:18 -08:00
committed by Konstantin Käfer
parent 2075d6bb9a
commit d62bf415f0

View File

@@ -100,6 +100,10 @@ void HeadlessView::loadExtensions() {
}
void HeadlessView::createContext() {
if (!display_) {
throw std::runtime_error("Display is not set");
}
#if MBGL_USE_CGL
CGLError error = CGLCreateContext(display_->pixelFormat, NULL, &glContext);
if (error != kCGLNoError) {