According to the safety documentation for CStr::from_ptr, it is undefined behavior for the pointer to be non-null. Currently, the functions for QMessageLogContext do not check for null pointers, even though Qt may use null pointers for some of those fields. I made a fix for this in #1399.