CID-39604: Fixed possible null dereferencing
Simplify logging domain
CID-24876: Actually check for the return value and raise a warning now