Added null check in paginator