Fix NullPointerException when creating a room bundle

This commit is contained in:
Alejandro 2019-06-16 13:46:27 +03:00
parent 40888f091c
commit b6aeaa9f37

View File

@ -589,24 +589,8 @@ public class CatalogManager {
return this.catalogPages.get(pageId);
}
public CatalogPage getCatalogPage(final String captionSafe) {
final CatalogPage[] page = {null};
synchronized (this.catalogPages) {
this.catalogPages.forEachValue(new TObjectProcedure<CatalogPage>() {
@Override
public boolean execute(CatalogPage object) {
if (object.getPageName().equalsIgnoreCase(captionSafe)) {
page[0] = object;
return false;
}
return true;
}
});
return page[0];
}
public CatalogPage getCatalogPage(String captionSafe) {
return this.catalogPages.valueCollection().stream().filter(p -> p.getPageName().equalsIgnoreCase(captionSafe)).findAny().orElse(null);
}