Handle case where Webamp has already closed when the modal is closed

This commit is contained in:
Jordan Eldredge 2018-11-26 21:39:56 -08:00
parent 7fd0c28332
commit ee895f7aa3

View file

@ -14,7 +14,9 @@ export default class WebampComponent extends React.Component {
if (this._webamp) {
// TODO: Repace this with this._webamp.destroy() once we upgrade.
const close = document.querySelector("#webamp #close");
close.click();
if (close != null) {
close.click();
}
}
}