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

Widget.child throws if there is no child #691

Closed
whitebyte opened this issue Nov 18, 2024 · 1 comment · Fixed by #692
Closed

Widget.child throws if there is no child #691

whitebyte opened this issue Nov 18, 2024 · 1 comment · Fixed by #692

Comments

@whitebyte
Copy link
Contributor

auto widget = parent.childById("nonexistent"); // returns null
auto widget2 =parent.child(1000); // throws exception

Expected behavior: .child(x) should return null if there is no child with such index (or no children at all).
I can open a PR if maintainers agree

@GrimMaple
Copy link
Collaborator

According to this the base class already returns null. I think that "return null" is intended behavior, so I don't mind such PR at all :)
If you're at it -- please make sure that it's consistent across all subclasses

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 a pull request may close this issue.

2 participants