Skip to content

Commit

Permalink
fix: checking that acceptance is valid before selecting iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasNorin committed Dec 15, 2023
1 parent 68de185 commit 5968f40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/php/Component/Iframe/iframe.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function(e) {
return;
}
const acceptance = document.querySelector('#acceptance-{{$id}}');
const iframe = acceptance.querySelector('#{{$id}}');
let message = e.data;
const iframe = acceptance?.querySelector('#{{$id}}');
const message = e.data;
if(iframe && acceptance && message && message.height) {
if(iframe && message && message.height) {
iframe.height = message.height;
acceptance.style.height = message.height + 'px';
}
Expand Down

0 comments on commit 5968f40

Please sign in to comment.