If the list of depended entity IDs in CachingResultBuilder is empty for some reason, something must be wrong – at least the entity itself should always be in that set. In any event, there’s no point asking the WikiPageMetaDataAccessor for revision IDs in that case, at the risk of it issuing some empty query. Just short-circuit in getLatestRevisionIds instead.
Part of https://wikitech.wikimedia.org/wiki/Incident_documentation/20180226-WikibaseQualityConstraints.