diff --git a/src/render.cpp b/src/render.cpp index 433d5ec..80be612 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -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];