Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix possible infinite loop on widget start (#7071)
Browse files Browse the repository at this point in the history
* fix 15494 infinit loop on widget start error

* change message to error from log
and fix block style
  • Loading branch information
toger5 authored Nov 4, 2021
1 parent c18c66f commit 558a620
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default class AppTile extends React.Component<IProps, IState> {
this.sgWidget.on("ready", this.onWidgetReady);
this.startWidget();
} catch (e) {
logger.log("Failed to construct widget", e);
logger.error("Failed to construct widget", e);
this.sgWidget = null;
}
}
Expand All @@ -241,7 +241,13 @@ export default class AppTile extends React.Component<IProps, IState> {
private iframeRefChange = (ref: HTMLIFrameElement): void => {
this.iframe = ref;
if (ref) {
if (this.sgWidget) this.sgWidget.start(ref);
try {
if (this.sgWidget) {
this.sgWidget.start(ref);
}
} catch (e) {
logger.error("Failed to start widget", e);
}
} else {
this.resetWidget(this.props);
}
Expand Down

0 comments on commit 558a620

Please sign in to comment.