-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
System.AccessViolationException in .NET wrapper when getting the distance of a point #4877
Comments
@morcibacsi , according to the attached screenshot you're passing a negative |
@ev-mp I am fully aware of that. As you can see on the screenshot, I have the necessary checks (it is just commented out) to avoid the Exception. My point was that the AccessViolationException is not the best to throw from the SDK. An ArgumentOutOfRangeException would be more appropriate. |
@morcibacsi , I agree that the input validation should be performed by SDK to improve the users' experience. |
Hi @morcibacsi, Do you have further questions on this? Can we close it? |
@RealSenseCustomerSupport Can be closed. Thanks for the fix. |
Issue Description
I am using the .NET wrapper and EmguCV to detect objects and their real world size. Sometimes I fail to detect the coordinates of the object properly. When this happens I pass invalid coordinates to the GetDistance(x, y) method of the DepthFrame class and the method raises a System.AccessViolationException. Of course I can avoid this with additional checks (like in the screenshot below), however maybe it would be nice if the method would fail in a more developer-friendly way (like a custom exception or a return value which indicates the error).
The text was updated successfully, but these errors were encountered: