View Single Post
04-11-13, 08:52 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
It's usually best to just check the most directly related thing -- in this case, the data you actually want to work with is the expiration time, so just check if that has a value. If it does, you're good to go. Checking other things like the buff name or caster unit may work, but is really just superfluous and doesn't necessarily guarantee that the data you want is there.

It's similar to browser sniffing vs. feature detection in JavaScript, if you do any web development -- you should always just check to see if the feature you want to use exists, instead of trying to figure out which version of which browser is running your code and make assumptions about which features that version of that browser supports. Unfortunately, a lot of sites use browser sniffing, which leads to the endless "site X doesn't work in browser Y" problems.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote