diff --git a/app/assets/javascripts/sitewide/bio_eddie.js b/app/assets/javascripts/sitewide/bio_eddie.js index 33b3f61d9..d4e42fbdd 100644 --- a/app/assets/javascripts/sitewide/bio_eddie.js +++ b/app/assets/javascripts/sitewide/bio_eddie.js @@ -89,11 +89,13 @@ var bioEddieEditor = (function() { $(document).on('turbolinks:load', function() { bioEddieIframe = document.getElementById('bioEddieIframe'); bioEddieModal = $('#bioEddieModal'); - bioEddieIframe.onload = function() { - BIO_EDDIE = bioEddieIframe.contentWindow.bioEddieEditor; - CHEMAXON = bioEddieIframe.contentWindow.chemaxon; - importMolecule(); - }; + if (bioEddieIframe) { + bioEddieIframe.onload = function() { + BIO_EDDIE = bioEddieIframe.contentWindow.bioEddieEditor; + CHEMAXON = bioEddieIframe.contentWindow.chemaxon; + importMolecule(); + }; + } bioEddieModal.on('shown.bs.modal', function() { initIframe();