Skip to content

Commit

Permalink
fix cast crash (#14351)
Browse files Browse the repository at this point in the history
Co-authored-by: Bogdan Zavu <[email protected]>
  • Loading branch information
BogdanZavu and zavub authored Aug 31, 2023
1 parent 8d797c9 commit e4ef88c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,9 @@ public override void GenerateViewGeometryFromRenderPackagesAndRequestUpdate(Rend
renderTimer.Start();
#endif
var packages = taskPackages.Packages;
var meshPackages = packages.Cast<HelixRenderPackage>().Where(rp => rp.MeshVertexCount % 3 == 0);

var meshPackages = packages.Where(renderPackage => (renderPackage as HelixRenderPackage)?.MeshVertexCount % 3 == 0)
.Select(renderPackage => renderPackage as HelixRenderPackage);

RemoveGeometryForUpdatedPackages(meshPackages);
try
Expand Down

0 comments on commit e4ef88c

Please sign in to comment.