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