[2.7.x] NEXUS-6230: Backport to 2.7.x

Nullcheck was missing for listedGav
As the folder might contain maven metadata and other stuff
that M2GavCalculator cannot interpret, and will return
null.

Original PR
https://github.com/sonatype/nexus-oss/pull/321

Issue
https://issues.sonatype.org/browse/NEXUS-6230

CI
TBD