Review: Needs Fixing

Rather than wrapping the code in a try...except, change the elif to:

  elif hasattr(song, 'book') and song.book:

This will check if the attribute exists before trying to work with it, and is 
more efficient since you're not invoking the try and dealing with the odd 
exception.

Also don't forget to backport the fix to 2.4 once this one is done.
-- 
https://code.launchpad.net/~ldeks/openlp/ldeks-bugfix/+merge/312962
Your team OpenLP Core is subscribed to branch lp:openlp.

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to