Skip to content

Commit f4b7578

Browse files
committed
chore: change rest of the files to pass only real path
1 parent 23924b1 commit f4b7578

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/react-native-executorch/src/modules/general/ExecutorchModule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)