summaryrefslogtreecommitdiff
path: root/src/mbgl/style/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/parser.cpp')
-rw-r--r--src/mbgl/style/parser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbgl/style/parser.cpp b/src/mbgl/style/parser.cpp
index 56e6f8ad01..2746b8af92 100644
--- a/src/mbgl/style/parser.cpp
+++ b/src/mbgl/style/parser.cpp
@@ -35,7 +35,8 @@ void Parser::parse(const std::string& json) {
}
if (document.HasMember("version")) {
- int version = document["version"].GetInt();
+ const JSValue& versionValue = document["version"];
+ const int version = versionValue.IsNumber() ? versionValue.GetInt() : 0;
if (version != 8) {
Log::Warning(Event::ParseStyle, "current renderer implementation only supports style spec version 8; using an outdated style will cause rendering errors");
}