Can we check if `$container` exists before returning it?