mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-gtk: add pathological check for axis
That way we don't give values back that will not make any sense.
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "sysprof-axis-private.h"
|
||||
#include "sysprof-xy-layer-private.h"
|
||||
|
||||
enum {
|
||||
@ -192,6 +193,16 @@ _sysprof_xy_layer_get_xy (SysprofXYLayer *self,
|
||||
g_return_if_fail (y_values != NULL);
|
||||
g_return_if_fail (n_values != NULL);
|
||||
|
||||
if (self->x_axis == NULL || _sysprof_axis_is_pathological (self->x_axis) ||
|
||||
self->y_axis == NULL || _sysprof_axis_is_pathological (self->y_axis))
|
||||
{
|
||||
*n_values = 0;
|
||||
*x_values = NULL;
|
||||
*y_values = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
*x_values = sysprof_normalized_series_get_values (self->normal_x, &n_x_values);
|
||||
*y_values = sysprof_normalized_series_get_values (self->normal_y, &n_y_values);
|
||||
*n_values = MIN (n_x_values, n_y_values);
|
||||
|
||||
Reference in New Issue
Block a user