*/
private String getAlbumId(String phrase) {
String albumId = phrase.startsWith("album://") ? phrase.substring(8) : phrase;
- return (webInterface.getCore().getAlbum(albumId, false) != null) ? albumId : null;
+ return webInterface.getCore().getAlbum(albumId).isPresent() ? albumId : null;
}
/**
*/
private String getImageId(String phrase) {
String imageId = phrase.startsWith("image://") ? phrase.substring(8) : phrase;
- return (webInterface.getCore().getImage(imageId, false) != null) ? imageId : null;
+ return webInterface.getCore().getImage(imageId).isPresent() ? imageId : null;
}
/**
@Override
public boolean apply(Hit<?> hit) {
- return hit.getScore() > 0;
+ return (hit == null) ? false : hit.getScore() > 0;
}
};