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

Incorrect exception type is thrown in PointCloud::at #2520

Closed
csukuangfj opened this issue Oct 6, 2018 · 0 comments · Fixed by #2521
Closed

Incorrect exception type is thrown in PointCloud::at #2520

csukuangfj opened this issue Oct 6, 2018 · 0 comments · Fixed by #2521

Comments

@csukuangfj
Copy link
Contributor

Your Environment

  • PCL Version: the master branch

Context

See the code

inline const PointT&
at (int column, int row) const
{
if (this->height > 1)
return (points.at (row * this->width + column));
else
throw IsNotDenseException ("Can't use 2D indexing with a unorganized point cloud");
}

inline PointT&
at (int column, int row)
{
if (this->height > 1)
return (points.at (row * this->width + column));
else
throw IsNotDenseException ("Can't use 2D indexing with a unorganized point cloud");
}

Expected Behavior

It should throw

class UnorganizedPointCloudException : public PCLException

Current Behavior

It throws

class IsNotDenseException : public PCLException

Code to Reproduce

See the code above.

Possible Solution

Throw

class UnorganizedPointCloudException : public PCLException

taketwo pushed a commit that referenced this issue Oct 7, 2018
…2521)

Throw UnorganizedPointCloudException in PointCloud::at
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.

1 participant