Made sure empty containers don't crash with a nullptr exception