The `tselem->id` pointer can also be used for non-ID data (according to this comment in DNA_outliner_types.h: ``` /* XXX We actually also store non-ID data in this pointer for identifying * the TreeStoreElem for a TreeElement when rebuilding the tree. Ugly! */ ``` As such, I don't mind adding a `NULL`-check in the `is_object_data_in_editmode()` function. After all, when there is no object, its data certainly is not in edit mode.