Skip to content

Commit

Permalink
fix: an issue that crashes when cancel is not present (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajakka authored Nov 18, 2024
1 parent d545ff2 commit bff3b07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default class Pdf extends Component {

if ((nextSource.uri !== curSource.uri)) {
// if has download task, then cancel it.
if (this.lastRNBFTask) {
if (this.lastRNBFTask && this.lastRNBFTask.cancel) {
this.lastRNBFTask.cancel(err => {
this._loadFromSource(this.props.source);
});
Expand Down

0 comments on commit bff3b07

Please sign in to comment.