mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +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);
|
SysprofNormalizedSeries *self = SYSPROF_NORMALIZED_SERIES (series);
|
||||||
SysprofNormalizedSeriesItem *ret;
|
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,
|
ret = g_object_new (SYSPROF_TYPE_NORMALIZED_SERIES_ITEM,
|
||||||
"item", item,
|
"item", item,
|
||||||
"value", g_array_index (self->values, double, position),
|
"value", g_array_index (self->values, double, position),
|
||||||
|
|||||||
Reference in New Issue
Block a user