Check that the entity type and ID are valid arguments
Since the app elements could be print also before the contextual links arguments are initialized, we have to validate them before fetching the links.
Since the app elements could be print also before the contextual links arguments are initialized, we have to validate them before fetching the links.