Bugfix missing null check on logger ptr.

I haven't checked everything, these are the ones I've found so far.