Added null-check for cases when a null body is being logged