Fix T93431: Crash when empty is marked as asset
Make `ED_preview_id_is_supported(ID *)` NULL-safe. It's semantically
valid, as it's not possible to render a preview of a NULL ID.
The crash was introduced in 481f032f5c
Reviewed By: sybren, jbakker
Maniphest Tasks: T93431
Differential Revision: https://developer.blender.org/D13398
This commit is contained in:
parent
b31250feba
commit
03c9563582
Notes:
blender-bot
2023-02-13 17:00:34 +01:00
Referenced by issue #93431, Asset Browser: Crash on add Empty or collection instance
|
@ -1764,6 +1764,10 @@ static void icon_preview_free(void *customdata)
|
|||
*/
|
||||
bool ED_preview_id_is_supported(const ID *id)
|
||||
{
|
||||
if (id == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GS(id->name) == ID_OB) {
|
||||
return object_preview_is_type_supported((const Object *)id);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue