Skip to content

Commit

Permalink
Add check for parent node (#2631)
Browse files Browse the repository at this point in the history
  • Loading branch information
rejas committed Jan 15, 2021
1 parent 96d3ef0 commit 8469e43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion feature-detects/forms/inputnumber-l10n.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ define(['Modernizr', 'createElement', 'getBody', 'test/inputtypes', 'test/forms/

/* cleanup */
body.removeChild(div);
if (body.fake) {
if (body.fake && body.parentNode) {
body.parentNode.removeChild(body);
}

Expand Down
2 changes: 1 addition & 1 deletion src/injectElementWithStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ define(['ModernizrProto', 'docElement', 'createElement', 'getBody'], function(Mo

ret = callback(div, rule);
// If this is done after page load we don't want to remove the body so check if body exists
if (body.fake) {
if (body.fake && body.parentNode) {
body.parentNode.removeChild(body);
docElement.style.overflow = docOverflow;
// Trigger layout so kinetic scrolling isn't disabled in iOS6+
Expand Down

0 comments on commit 8469e43

Please sign in to comment.