Skip to content

Commit

Permalink
reject if sessionId is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
superandrew213 authored Feb 2, 2022
1 parent c63401a commit cb12474
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions react-native/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,13 @@ export class AbstractSession extends Session {
}

/**
* Cancels running the session.
* Cancels running the session. Only starts cancellation. Does not guarantee that session is cancelled when promise resolves.
*/
async cancel() {
const sessionId = this.getSessionId();
if (sessionId !== undefined) {
if (sessionId === undefined) {
return Promise.reject(new Error('sessionId is not defined'));
} else {
return FFmpegKitReactNativeModule.cancelSession(sessionId);
}
}
Expand Down

0 comments on commit cb12474

Please sign in to comment.