question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UICollection.[] getter method should throw when index is invalid

See original GitHub issue

Describe the bug

image

The first line var ch0 = grid.Children[10]; should also throw ArgumentOutOfRangeException

Current implementation just returns null, which is very misleading

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewleadercommented, Jun 2, 2021

@jtorjo we (thankfully) have a couple very helpful community members, including @Jaiganeshkumaran and riverar!

This is indeed a WinUI XAML bug, transferring this bug now. Thanks for reporting it!

1reaction
jtorjocommented, Jun 1, 2021

Someone at Microsoft, please tell me - is @Jaiganeshkumaran working for you? Or is he just “trying to be helpful”?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to return on an IndexOutOfBoundsException exception?
If you want to be clear that the method can throw an exception, just say so: public User getUser(int index) throws IndexOutOfBoundsException {...
Read more >
Should a getter throw an exception if its object has invalid ...
If surname or name being null is a valid state for the object, then handle it accordingly. But if it's not a valid...
Read more >
Exceptions should not be thrown from property getters
If exceptions need to be thrown, it is best to convert the property to a method. It is valid to throw exceptions from...
Read more >
Checking for elements: contains, indexOf, any, every
indexOf(element)` returns the index of the given element in the list. ... This method will touch every element in the iterable, in order, ......
Read more >
Using Indexers - C# Programming Guide
Learn how to declare and use an indexer for a class, struct, or interface in C#. This article includes example code.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found