Check if we got a dict before formatting the string