don't assume we have a valid rntuple in render.cpp

This commit is contained in:
silverweed 2024-10-04 16:34:20 +02:00
parent 7be716aa5e
commit 0ae49de018

View file

@ -169,7 +169,8 @@ void viewer_jump_to(App_State &app, u64 addr)
internal
Page_Info_Node *viewer_jump_to_page(App_State &app, u64 page_idx)
{
assert(app.rndata.n_pages > 0);
if (app.rndata.n_pages == 0)
return nullptr;
page_idx = (page_idx + app.rndata.n_pages) % app.rndata.n_pages;
// @Speed
@ -188,7 +189,8 @@ Page_Info_Node *viewer_jump_to_page(App_State &app, u64 page_idx)
internal
void viewer_jump_to_page_list(App_State &app, u64 page_list_idx)
{
assert(app.rndata.n_cluster_groups > 0);
if (app.rndata.n_cluster_groups == 0)
return;
page_list_idx = (page_list_idx + app.rndata.n_cluster_groups) % app.rndata.n_cluster_groups;
Cluster_Group_Info &cg_info = app.rndata.cluster_groups[page_list_idx];
@ -200,7 +202,8 @@ void viewer_jump_to_page_list(App_State &app, u64 page_list_idx)
internal
void viewer_jump_to_cluster(App_State &app, u64 cluster_idx)
{
assert(app.rndata.n_clusters > 0);
if (app.rndata.n_clusters == 0)
return;
cluster_idx = (cluster_idx + app.rndata.n_clusters) % app.rndata.n_clusters;
Cluster_Info &cluster = app.rndata.clusters[cluster_idx];