Fix T40823, crash with LoD operator without valid object.

This commit is contained in:
Thomas Dinges 2014-06-26 23:51:28 +02:00
parent dcc6300ddd
commit 92ecbd2998
Notes: blender-bot 2023-02-14 10:25:59 +01:00
Referenced by issue #40823, Remove Level of Details command = crash
1 changed files with 3 additions and 0 deletions

View File

@ -1083,6 +1083,9 @@ void BKE_object_lod_sort(Object *ob)
bool BKE_object_lod_remove(Object *ob, int level)
{
LodLevel *rem;
if (ob == NULL)
return false;
if (level < 1 || level > BLI_countlist(&ob->lodlevels) - 1)
return false;