File tree Expand file tree Collapse file tree
packages/react-native-executorch/src/modules
natural_language_processing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ export class ExecutorchModule extends BaseModule {
2828 onDownloadProgressCallback ,
2929 modelSource
3030 ) ;
31- if ( paths === null || paths . length < 1 ) {
31+ if ( paths === null || paths . length < 1 || paths [ 0 ] === undefined ) {
3232 throw new RnExecutorchError (
3333 RnExecutorchErrorCode . DownloadInterrupted ,
3434 'The download has been interrupted. As a result, not every file was downloaded. Please retry the download.'
3535 ) ;
3636 }
37- this . nativeModule = global . loadExecutorchModule ( paths [ 0 ] || '' ) ;
37+ this . nativeModule = global . loadExecutorchModule ( paths [ 0 ] ) ;
3838 } catch ( error ) {
3939 Logger . error ( 'Load failed:' , error ) ;
4040 throw parseUnknownError ( error ) ;
Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ export class VADModule extends BaseModule {
2828 onDownloadProgressCallback ,
2929 model . modelSource
3030 ) ;
31- if ( paths === null || paths . length < 1 ) {
31+ if ( paths === null || paths . length < 1 || paths [ 0 ] === undefined ) {
3232 throw new RnExecutorchError (
3333 RnExecutorchErrorCode . DownloadInterrupted ,
3434 'The download has been interrupted. As a result, not every file was downloaded. Please retry the download.'
3535 ) ;
3636 }
37- this . nativeModule = global . loadVAD ( paths [ 0 ] || '' ) ;
37+ this . nativeModule = global . loadVAD ( paths [ 0 ] ) ;
3838 } catch ( error ) {
3939 Logger . error ( 'Load failed:' , error ) ;
4040 throw parseUnknownError ( error ) ;
You can’t perform that action at this time.
0 commit comments