Skip to content

Commit

Permalink
Merge pull request #79 from yma96/2.0.x
Browse files Browse the repository at this point in the history
Fix potential NPE when doing local folo record
  • Loading branch information
yma96 authored Feb 1, 2024
2 parents 4ad2eb0 + aee6e44 commit cd788d1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,18 @@ public void storeTrackedDownload( JsonObject message )
logger.debug( "Consuming folo record seal event for path:{}, trackingId:{}", trackingPath, trackingId );

HistoricalEntryDTO entryDTO = historicalContentMap.get( trackingPath );
if ( entryDTO == null )
if ( null == entryDTO )
{
logger.warn( "No historical entry meta is found for tracking {}.", trackingPath );
return;
}
String originalUrl = entryDTO.getOriginUrl() == null ? "" : entryDTO.getOriginUrl();
StoreKey storeKey = entryDTO.getStoreKey();
if ( null == storeKey )
{
logger.warn( "No StoreKey is found for tracking {} historical entry.", trackingPath );
return;
}
String originalUrl = entryDTO.getOriginUrl() == null ? "" : entryDTO.getOriginUrl();
Response response = trackingService.recordArtificat( trackingId, trackingPath, storeKey.getPackageType(),
storeKey.getType().name(), storeKey.getName(), originalUrl,
entryDTO.getSize(), entryDTO.getMd5(), entryDTO.getSha1(),
Expand Down

0 comments on commit cd788d1

Please sign in to comment.