mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-analyze: return NULL if series is empty
This commit is contained in:
@ -150,7 +150,11 @@ sysprof_time_series_get_values (const SysprofTimeSeries *self,
|
||||
guint *n_values)
|
||||
{
|
||||
*n_values = self->values->len;
|
||||
return &g_array_index (self->values, SysprofTimeSeriesValue, 0);
|
||||
|
||||
if (self->values->len > 0)
|
||||
return &g_array_index (self->values, SysprofTimeSeriesValue, 0);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@ -169,7 +169,11 @@ sysprof_xy_series_get_values (const SysprofXYSeries *self,
|
||||
guint *n_values)
|
||||
{
|
||||
*n_values = self->values->len;
|
||||
return &g_array_index (self->values, SysprofXYSeriesValue, 0);
|
||||
|
||||
if (self->values->len > 0)
|
||||
return &g_array_index (self->values, SysprofXYSeriesValue, 0);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user