Avoid close addRepositoryFragment on invalid URL