aussieaddons / script.module.aussieaddonscommon

Common functions for Aussie Add-ons
GNU General Public License v3.0
1 stars 5 forks source link

Make Kodi version getting safer #12

Open glennguy opened 4 years ago

glennguy commented 4 years ago

This way we still end up with the same data type to operate on -> avoid type errors

glennguy commented 4 years ago

Hey @andybotting just wondering your thoughts on this :)

andybotting commented 4 years ago

Have you had errors with this previously, or is it just to make it easier for testing?

Either way, I think it looks OK. Defensive coding is always a good thing

glennguy commented 4 years ago

Have you had errors with this previously, or is it just to make it easier for testing?

I've been checking the major version in a couple of cases recently, for either inputstream adaptive version checking or testing whether I can use more recent Kodi Python API calls.

What got me thinking about safeness is that I remember from a couple of years ago there was one of the xbmc.getInfoLabel calls that would sometimes return an empty string the first time it was called, and my feeling was that it is this one - System.BuildVersion. So just being a little defensive :)