Added null check for presence error stanza namespace element

Issue #341