mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Allow image loads to fail without crashing render
This commit is contained in:
parent
b3db735415
commit
b8450f4d4a
@ -83,7 +83,11 @@ export default class ImageLoader {
|
||||
|
||||
ready(): Promise<ImageStore> {
|
||||
const keys = Object.keys(this.cache);
|
||||
return Promise.all(keys.map(str => this.cache[str])).then(images => {
|
||||
return Promise.all(keys.map(str => this.cache[str].catch(e => {
|
||||
if (__DEV__) {
|
||||
this.logger.log(`Unable to load image`, e);
|
||||
}
|
||||
}))).then(images => {
|
||||
if (__DEV__) {
|
||||
this.logger.log('Finished loading images', images);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user