reject if sessionId is not defined

pull/339/head
Andrew Shini 3 years ago committed by GitHub
parent c63401acf3
commit cb124749a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      react-native/src/index.js

@ -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);
}
}

Loading…
Cancel
Save