Bug 1684195 - Avoid and ignore Card errored image loading "uncaught exception: Object" r=thecount

Differential Revision: https://phabricator.services.mozilla.com/D110956
This commit is contained in:
Ed Lee 2021-04-06 23:05:33 +00:00
parent a6a94c7a07
commit e27a099a1d
2 changed files with 13 additions and 2 deletions

View File

@ -64,7 +64,12 @@ export class _Card extends React.PureComponent {
}
// Wait for the image whether just started loading or reused promise
await gImageLoading.get(imageUrl);
try {
await gImageLoading.get(imageUrl);
} catch (ex) {
// Ignore the failed image without changing state
return;
}
// Only update state if we're still waiting to load the original image
if (

View File

@ -7727,7 +7727,13 @@ class _Card extends react__WEBPACK_IMPORTED_MODULE_5___default.a.PureComponent {
} // Wait for the image whether just started loading or reused promise
await gImageLoading.get(imageUrl); // Only update state if we're still waiting to load the original image
try {
await gImageLoading.get(imageUrl);
} catch (ex) {
// Ignore the failed image without changing state
return;
} // Only update state if we're still waiting to load the original image
if (content_src_lib_screenshot_utils__WEBPACK_IMPORTED_MODULE_6__["ScreenshotUtils"].isRemoteImageLocal(this.state.cardImage, this.props.link.image) && !this.state.imageLoaded) {
this.setState({