make sure statistics query result is not nil to prevent runtime crashes