diff --git a/lib/html_graph.php b/lib/html_graph.php
index 65faf3aa1a..0871139e8b 100644
--- a/lib/html_graph.php
+++ b/lib/html_graph.php
@@ -868,7 +868,7 @@ function html_graph_preview_view() {
}
if (get_request_var('graphs') == '-1') {
- $graph_rows = read_user_setting('preview_graphs_per_page', read_config_option('preview_graphs_per_page'), 20);
+ $graph_rows = read_user_setting('preview_graphs_per_page', read_config_option('preview_graphs_per_page') ?? 20);
} else {
$graph_rows = get_request_var('graphs');
}
diff --git a/lib/html_tree.php b/lib/html_tree.php
index 00414e366c..1002a9ecf9 100644
--- a/lib/html_tree.php
+++ b/lib/html_tree.php
@@ -1331,7 +1331,7 @@ function grow_right_pane_tree($tree_id, $leaf_id, $host_group_data) {
}
if (get_request_var('graphs') == '-1') {
- $graph_rows = read_user_setting('treeview_graphs_per_page', read_config_option('treeview_graphs_per_page'), 10);
+ $graph_rows = read_user_setting('treeview_graphs_per_page', read_config_option('treeview_graphs_per_page') ?? 10);
} else {
$graph_rows = get_request_var('graphs');
}