Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentElement was null in rare cases #4981

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

mkslanc
Copy link
Contributor

@mkslanc mkslanc commented Nov 3, 2022

Issue #, if available: #4634

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mkslanc mkslanc marked this pull request as ready for review November 3, 2022 18:30
src/lib/dom.js Outdated
var body = document.documentElement;
body.appendChild(outer);
var body = (doc && doc.documentElement) || (document && document.documentElement);
if (body) {
Copy link
Member

@nightwing nightwing Nov 3, 2022

Choose a reason for hiding this comment

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

it is better to do if (!body) return 0;,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Base: 86.08% // Head: 86.09% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (469d587) compared to base (0c49167).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4981      +/-   ##
==========================================
+ Coverage   86.08%   86.09%   +0.01%     
==========================================
  Files         544      546       +2     
  Lines       41511    41550      +39     
  Branches     6547     6549       +2     
==========================================
+ Hits        35735    35774      +39     
  Misses       5776     5776              
Flag Coverage Δ
unittests 86.09% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/ace_test.js 98.86% <100.00%> (+0.16%) ⬆️
src/lib/dom.js 83.59% <100.00%> (+0.08%) ⬆️
src/mode/jexl.js 100.00% <0.00%> (ø)
src/mode/jexl_highlight_rules.js 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@andrewnester andrewnester merged commit df44158 into ajaxorg:master Nov 4, 2022
@mkslanc mkslanc deleted the template-ace-bug branch November 4, 2022 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants