fixing issue 540

fix for #issue #540 "Impossible to access an attribute ("ProviderMetadata") on a NULL variable ("") in SonataMediaBundle:MediaAdmin:select_provider.html.twig".