Skip to content

Commit

Permalink
Merge pull request #5289 from cb1kenobi/timob-16214_3_2_X
Browse files Browse the repository at this point in the history
[TIMOB-16214] Added a try/catch to detect bad module jar files.
  • Loading branch information
srahim committed Feb 4, 2014
2 parents 374e9b9 + 8a4fcba commit c34c238
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -1479,12 +1479,17 @@ AndroidBuilder.prototype.validate = function validate(logger, config, cli) {

if (module.jarFile) {
// read in the bindings
module.bindings = this.getNativeModuleBindings(module.jarFile);
if (!module.bindings) {
logger.error(__('Module %s version %s is missing bindings json file', module.id.cyan, (module.manifest.version || 'latest').cyan) + '\n');
try {
module.bindings = this.getNativeModuleBindings(module.jarFile);
if (!module.bindings) {
logger.error(__('Module %s version %s is missing bindings json file', module.id.cyan, (module.manifest.version || 'latest').cyan) + '\n');
process.exit(1);
}
bindingsHashes.push(hash(JSON.stringify(module.bindings)));
} catch (ex) {
logger.error(__('The module "%s" has an invalid jar file: %s', module.id, module.jarFile) + '\n');
process.exit(1);
}
bindingsHashes.push(hash(JSON.stringify(module.bindings)));
}

this.nativeLibModules.push(module);
Expand Down

0 comments on commit c34c238

Please sign in to comment.