iOS: fix when main bundle load error, exception is nil

This commit is contained in:
pengfei.zhou 2021-05-19 17:33:56 +08:00 committed by osborn
parent d7c5de4b90
commit 053e06ff2e

View File

@ -32,7 +32,9 @@ - (BOOL)filter:(NSString *)source {
NSError *error; NSError *error;
NSString *jsContent = [NSString stringWithContentsOfFile:fullPath encoding:NSUTF8StringEncoding error:&error]; NSString *jsContent = [NSString stringWithContentsOfFile:fullPath encoding:NSUTF8StringEncoding error:&error];
if (error) { if (error) {
[ret setupError:[NSException new]]; [ret setupError:[NSException exceptionWithName:@"Loading JS in Main bundle error"
reason:error.description
userInfo:error.userInfo]];
} else { } else {
[ret setupResult:jsContent]; [ret setupResult:jsContent];
} }