xmyno / Broker_WorldQuests

World of Warcraft addon for displaying world quests in list form.
http://www.wowinterface.com/downloads/info23964-Broker_WorldQuests.html
MIT License
11 stars 11 forks source link

Fix nil comparison error #33

Closed justinkb closed 5 years ago

justinkb commented 5 years ago

With the latest patch, your addon still produced LUA errors because of WQs with no expiration date (like Ivus in Darkshore)

This fixes that issue

xmyno commented 5 years ago

Completely forgot that it's used in sort by time too. Fixed it a bit differently directly at the source so it doesn't happen again. Guess they changed the world boss quests to return nil to fix their own UI showing "expires soon" icon on the map incorrectly..

Thanks for the report and PR anyway! Greatly appreciated.

justinkb commented 5 years ago

Interesting, I had no idea you could do "or 0" in lua, that's some nice syntactic sugar

xmyno commented 5 years ago

It's basically an inline if, yes. Also works with multiple branches, for example local largerNumber = a > b and a or b. Very handy 👍