Fixes #2026

Added check to see if array key for content type is set.