Use getAllArtifacts() and added a null check.