Protect against edge cases when logging