Page MenuHome

BKE_previewimg_id_supports_jobs assumes a valid id, but in some cases the id was not valid.
ClosedPublic

Authored by Eric Cosky (eric_cosky) on Dec 16 2020, 1:58 AM.

Details

Summary

This change is a simple null check on the ID provided to icon_set_image() which appears to be a legitimate value for the ID when used by some addins (discovered with PowerSave shortly after syncing to main).
I had previously attempted to fix this by having icon_set_image() return early if the provided ID was null, but this resulted in the PowerSave icon never being updated.
After adding the check so that it would not dereference null, but would call ED_preview_icon_job(), the crash no longer happened and the PowerSave icon was visible as expected.

Diff Detail

Repository
rB Blender

Event Timeline

Eric Cosky (eric_cosky) requested review of this revision.Dec 16 2020, 1:58 AM
Eric Cosky (eric_cosky) created this revision.

Makes sense, this is part of the (fragile...) code path that may indeed have a null ID. Thanks for the patch.

When submitting patches, better always assign a project, or it will be "orphaned" and nobody will notice it for a while. Just caught this by luck. That's a stupid problem we should solve somehow...

This revision is now accepted and ready to land.Dec 16 2020, 2:25 AM