diff --git a/src/main/java/org/ntlab/citrusserver/resources/PublicBooksRest.java b/src/main/java/org/ntlab/citrusserver/resources/PublicBooksRest.java index 99df9e9..71ce363 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/PublicBooksRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/PublicBooksRest.java @@ -64,11 +64,11 @@ @GET @Produces(MediaType.APPLICATION_JSON) public ArrayList searchBooksByTitleAndAccount(@QueryParam("search_title") String search_title, @QueryParam("search_account_id") String search_account_id) { - if(!search_title.isEmpty() && !search_account_id.isEmpty()) { + if(search_title != null && search_account_id != null) { return publicBookManager.searchBooksByTitleAndAccount(search_title, search_account_id); - } else if(!search_title.isEmpty()) { + } else if(search_title!= null) { return publicBookManager.searchBooksByTitle(search_title); - } else if(!search_account_id.isEmpty()) { + } else if(search_account_id != null) { return publicBookManager.searchBooksByAccount(search_account_id); } else { return publicBookManager.getAllPublicBooks();