mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: some resiliency checks
This commit is contained in:
@ -233,6 +233,15 @@ sysprof_normalized_series_get_series_item (SysprofSeries *series,
|
||||
SysprofNormalizedSeries *self = SYSPROF_NORMALIZED_SERIES (series);
|
||||
SysprofNormalizedSeriesItem *ret;
|
||||
|
||||
g_assert (SYSPROF_IS_NORMALIZED_SERIES (series));
|
||||
g_assert (G_IS_OBJECT (item));
|
||||
|
||||
if (position >= self->values->len)
|
||||
{
|
||||
g_object_unref (item);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = g_object_new (SYSPROF_TYPE_NORMALIZED_SERIES_ITEM,
|
||||
"item", item,
|
||||
"value", g_array_index (self->values, double, position),
|
||||
|
||||
Reference in New Issue
Block a user