code: @SuppressWarnings("null")
    protected final @Nullable String getMediaRef(@NotNull MediaRequest mediaRequest,
        @Nullable MediaHandlerConfig mediaHandlerConfig) {
      if (StringUtils.isNotEmpty(mediaRequest.getMediaRef())) {
        return mediaRequest.getMediaRef();
      }
      else if (mediaRequest.getResource() != null) {
        String refProperty = getMediaRefProperty(mediaRequest, mediaHandlerConfig);
        return mediaRequest.getResource().getValueMap().get(refProperty, String.class);
      }
      else {
        return null;
      }
    }
docs: Get media request path to media library
  @param mediaRequest Media request
  @param mediaHandlerConfig Media handler config (can be null, but should not be null)
  @return Path or null if not present