Switched code from using hasAttr followed by getAttr to simply call getAttr directly.

No functional changes intended.