LPS-49180 Fix ClassCastException when an external repository is created