You can't assume there's always a dataset. I'd put this in an if statement and just not monitor it if no monitoring dataset was provided.