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

Fix possible infinite loop on widget start #7071

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ 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.log("Failed to start widget", e); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we use blocks, we generally prefer to use the lines it gives us. Also, error for errors :)

Suggested change
} catch (e) { logger.log("Failed to start widget", e); }
} catch (e) {
logger.error("Failed to start widget", e);
}

} else {
this.resetWidget(this.props);
}
Expand Down