Fix #105325: crash calling asset_generate_preview() in backgound mode #106046

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:105325 into main 2023-03-24 09:17:12 +01:00
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@
#include "BKE_asset.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_icons.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
@ -52,7 +53,7 @@ void ED_asset_generate_preview(const bContext *C, ID *id)
BKE_previewimg_clear(preview);
}
UI_icon_render_id(C, nullptr, id, ICON_SIZE_PREVIEW, true);
UI_icon_render_id(C, nullptr, id, ICON_SIZE_PREVIEW, !G.background);
lichtwerk marked this conversation as resolved Outdated

I'd shorten this to !G.background.

I'd shorten this to `!G.background`.
}
bool ED_asset_clear_id(ID *id)