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 error reading array that could be undefined in ows service #8428

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ianwallen
Copy link
Contributor

@ianwallen ianwallen commented Oct 13, 2024

Fix error reading array that could be undefined in ows service

Without this fix the following error could be displayed in JavaScript console
Cannot read properties of undefined (reading 'length')

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

   Cannot read properties of undefined (reading 'length')
@ianwallen ianwallen added this to the 4.4.6 milestone Oct 14, 2024
@josegar74
Copy link
Member

@ianwallen do you have a service that cause the issue and can be used for testing?

@ianwallen ianwallen added the bug label Oct 14, 2024
@ianwallen
Copy link
Contributor Author

While I was testing the file uploads for #8427 in our environment which was based on GN 4.2.9 branch, I was seeing the error constantly showing up in the java console. I assumed that it was good practice to add a if (Array.isArray(layers)) { before using the array.
If it should never happen that layers is not an array and it is always defined then we can abandon this PR and I can raise a bug the next time I see the error occur.

@fxprunayre fxprunayre modified the milestones: 4.4.6, 4.4.7 Oct 24, 2024
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants