until https://bugzilla.mozilla.org/show_bug.cgi?id=822522 is fixed we need to check for null as well. I will add a comment indicating this fact