fix null pointer exception introduced while trying to avoid null pointers!
In LibraryService.java