inventory-framework
inventory-framework copied to clipboard
java.lang.NullPointerException: ComponentPhase root cannot be null
Is there an existing issue for this?
- [X] I have searched the existing issues
🐛 Describe the bug
When i try to open a computedAsyncPaginationState it doesn't open the gui and throws that error. i saw another issue about this problem but i don't know if it is exactly the same as this.
`private final State<Pagination> paginationState = computedAsyncPaginationState( (context) -> fetchWantedsFromDatabase(), (ctx, builder, index, value) -> { builder.buildComponent(ctx.getRoot()).getContainer().renderItem(index, new ItemStack(Material.EGG)); });
@Override
public void onInit(ViewConfigBuilder config) {
config.title("Lista ricercati");
config.size(45);
}
@Override
public void onFirstRender(@NotNull RenderContext render) {
final Pagination pagination = paginationState.get(render);
render.lastSlot(new ItemStack(Material.CLOCK))
.displayIf(pagination::isLoading)
.updateOnStateChange(paginationState);
}
private CompletableFuture<List<Wanted>> fetchWantedsFromDatabase() {
return Ricercati.getInstance().supplyAsync(() -> Ricercati.getInstance().getDatabase().getAllRicercati());
}`
✔️ Expected behavior
the gui to open
👣 Steps to Reproduce
create a computedAsyncPaginationState and add items
💻 Platform
- [X] Bukkit
- [ ] Sponge
- [ ] Other
⭐ Server Version
1.19.4
📚 Library Version
v3.1.0-rc
✍️ Additional context
No response