Skip to content

Commit

Permalink
fix NPE in case eTransl response does not come
Browse files Browse the repository at this point in the history
  • Loading branch information
SrdjanStevanetic committed May 15, 2024
1 parent 8560834 commit 9eff5d3
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,16 @@ private void createRedisMessageListenerAndWaitForResults(List<TranslationObj> tr
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("Received message from redis message listener is: {}", response);
}
if(response.contains(ETranslationTranslationService.eTranslationErrorCallbackIndicator)) {
//eTtransl error callback received
throw new TranslationException(response);
}
else if(response!=null) {
//extractTranslationsFromETranslationHtmlResponse(translationObjs, redisMessageListenerAdapter, response);
extractTranslationsFromETranslationResponse(translationObjs, redisMessageListenerAdapter, response);

if(response!=null) {
if(response.contains(ETranslationTranslationService.eTranslationErrorCallbackIndicator)) {
//eTtransl error callback received
throw new TranslationException(response);
}
else {
//extractTranslationsFromETranslationHtmlResponse(translationObjs, redisMessageListenerAdapter, response);
extractTranslationsFromETranslationResponse(translationObjs, redisMessageListenerAdapter, response);
}
}
/* unsubscibe this listener which automatically deletes the created pub/sub channel,
* which also gets deleted if the app is stopped or anyhow broken.
Expand Down

0 comments on commit 9eff5d3

Please sign in to comment.