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(GH-1432): Default content src when content tag is missing #1573

Merged
merged 1 commit into from Mar 21, 2023

Conversation

breautek
Copy link
Contributor

@breautek breautek commented Mar 20, 2023

Platforms affected

Android

Motivation and Context

fixes #1432

If the project is missing the <content> tag inside their config.xml, Cordova will completely crash with a fatal error.

Description

Inside ConfigXMLParser, I added a onPostParse private method in which I check to see if the contentSrc string is still null. If so, it can be assumed that the <content> tag was completely missing and the contentSrc string is then fallen back to the default content source, which is now powered by a constant.

Testing

Ran npm test and manually ran against a project with a missing <content>. Observing the crash in cordova-android@11, and observing the fix using locally packed tarball install.

Additionally I also tested renaming the index.html and setting <content src> respectfully to confirm no breakage.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek added the bug label Mar 20, 2023
@breautek breautek added this to the 12.0.0 milestone Mar 20, 2023
@breautek breautek requested a review from erisu March 20, 2023 13:06
@codecov-commenter
Copy link

Codecov Report

Merging #1573 (2e293b4) into master (04723eb) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1573   +/-   ##
=======================================
  Coverage   72.13%   72.13%           
=======================================
  Files          21       21           
  Lines        1751     1751           
=======================================
  Hits         1263     1263           
  Misses        488      488           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@breautek breautek changed the title fix(GH-1432): Default content src is content tag is missing fix(GH-1432): Default content src when content tag is missing Mar 20, 2023
@breautek breautek merged commit d4bfd50 into apache:master Mar 21, 2023
6 checks passed
@breautek breautek deleted the fix/gh-1432 branch March 21, 2023 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash app after update to cordova android 10.1.0
3 participants