Fixes #7322 - Fixed handling of empty body (just whitespaces)

Do we need the explicit return here? Since this function returns hash anyway, could we not just do something like `hash ||= {}` ?