diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-03-21 17:20:39 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-03-21 17:20:39 +0200 |
commit | 26d0a743b8ac74dcf9f36e5bf4888f4281d12275 (patch) | |
tree | f512d1b43e47e9fe4fb9dcea1dde85be8d95f5ba /platform/android/scripts/generate-style-code.js | |
parent | 9b1def0e7e5bf68f7a05ec0eff2b5d4540a883de (diff) | |
download | qtlocation-mapboxgl-26d0a743b8ac74dcf9f36e5bf4888f4281d12275.tar.gz |
[android] Fix style code generation if array default value is missing
Diffstat (limited to 'platform/android/scripts/generate-style-code.js')
-rwxr-xr-x | platform/android/scripts/generate-style-code.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js index 6f64a38a67..688a3aa527 100755 --- a/platform/android/scripts/generate-style-code.js +++ b/platform/android/scripts/generate-style-code.js @@ -198,7 +198,11 @@ global.defaultValueJava = function(property) { switch (property.value) { case 'string': case 'enum': - return '[' + property['default'] + "]"; + if (property['default'] !== undefined) { + return '[' + property['default'] + ']'; + } else { + return 'new String[0]'; + } case 'number': var result ='new Float[] {'; for (var i = 0; i < property.length; i++) { |