summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/json_schema_compiler/model.py')
-rw-r--r--tools/json_schema_compiler/model.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/json_schema_compiler/model.py b/tools/json_schema_compiler/model.py
index cc876df..7507ae7 100644
--- a/tools/json_schema_compiler/model.py
+++ b/tools/json_schema_compiler/model.py
@@ -486,8 +486,11 @@ class Platforms(object):
WIN = _PlatformInfo("win")
def _GetPlatforms(json):
- if 'platforms' not in json:
+ if 'platforms' not in json or json['platforms'] == None:
return None
+ # Sanity check: platforms should not be an empty list.
+ if not json['platforms']:
+ raise ValueError('"platforms" cannot be an empty list')
platforms = []
for platform_name in json['platforms']:
for platform_enum in _Enum.GetAll(Platforms):