--- Locking only redistributes or restricts weights when using bone groups. So, in addition to adding a NULL check to my last bit of code, I made has_locked_group() check for bone groups.