In TextureConverter:274 there's a possible InvalidOperationException when accessing polygonEntrance.Value. This will only occur when GetTopMostVertex returns null which will only occur when the texture is blank. As an example of where this might occur in the wild is with programmatically generated textures, or in my case, a texture atlas with the occasional blank tile.
My vote for a resolution is for the method to either return null, or return new List<Vertices>() or throw new Exception("Your texture is blank.") (or some message like that).
EDIT: After further testing, it looks like this method may also throw when there are one pixel wide polygons. I can reproduce consistently with some textures but not with others containing 1 pixel polygons. Will update when I figure out the pattern.
In TextureConverter:274 there's a possible InvalidOperationException when accessing
polygonEntrance.Value
. This will only occur whenGetTopMostVertex
returns null which will only occur when the texture is blank. As an example of where this might occur in the wild is with programmatically generated textures, or in my case, a texture atlas with the occasional blank tile.My vote for a resolution is for the method to either
return null
, orreturn new List<Vertices>()
orthrow new Exception("Your texture is blank.")
(or some message like that).EDIT: After further testing, it looks like this method may also throw when there are one pixel wide polygons. I can reproduce consistently with some textures but not with others containing 1 pixel polygons. Will update when I figure out the pattern.