Skip to content

Commit

Permalink
SearchMovieParser2: fix npe seen on sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
courville committed Jun 20, 2024
1 parent 4f14f5e commit 8a917a9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ public int compare(final BaseMovie bm1, final BaseMovie bm2) {
// Put in lower priority any entry that has no movie banned i.e. .*missing/movie.jpg as banner
isReleaseDateKnown = (movie.release_date != null);
String movieNameLC = movieName.toLowerCase();
levenshteinDistanceTitle = levenshteinDistance.apply(movieNameLC, result.getTitle().toLowerCase());
levenshteinDistanceOriginalTitle = levenshteinDistance.apply(movieNameLC, result.getOriginalTitle().toLowerCase());
String title = result.getTitle();
String originalTitle = result.getOriginalTitle();
levenshteinDistanceTitle = title != null ? levenshteinDistance.apply(movieNameLC, title.toLowerCase()) : Integer.MAX_VALUE;
levenshteinDistanceOriginalTitle = originalTitle != null ? levenshteinDistance.apply(movieNameLC, originalTitle.toLowerCase()) : Integer.MAX_VALUE;
log.debug("getSearchMovieParserResult: between " + movieNameLC + " and " + result.getOriginalTitle().toLowerCase() + "/" + result.getTitle().toLowerCase() + " levenshteinDistanceTitle=" + levenshteinDistanceTitle + ", levenshteinDistanceOriginalTitle=" + levenshteinDistanceOriginalTitle);

if (movie.poster_path == null || movie.poster_path.endsWith("missing/series.jpg") || movie.poster_path.endsWith("missing/movie.jpg") || movie.poster_path == "") {
Expand Down

0 comments on commit 8a917a9

Please sign in to comment.