fix: make sure we have data before computing stats

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>