1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-02 14:49:16 +02:00

Merge pull request #1118 from AmmiWang/patch-1

Update hook.js
This commit is contained in:
Fred Chasen 2021-03-08 11:44:20 -08:00 committed by GitHub
commit e2f90b3526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,11 @@ class Hook {
var promises = [];
this.hooks.forEach(function(task) {
var executing = task.apply(context, args);
try {
var executing = task.apply(context, args);
} catch (err) {
console.log(err);
}
if(executing && typeof executing["then"] === "function") {
// Task is a function that returns a promise