Commits

Ivan Vučica  committed df2498d

Fixed issues in case initialPresence in cfg was not set.

  • Participants
  • Parent commits 31a6139

Comments (0)

Files changed (1)

File zxmpp_stream.js

 
 				var initialPresence = this.zxmpp.cfg["initialPresence"];
 
-				ownPresence.show = initialPresence["show"] ? initialPresence["show"] : "avail";
-				ownPresence.status = (typeof initialPresence["status"] != 'undefined') ? initialPresence["status"] : "Using Z-XMPP";
-				ownPresence.priority = (typeof initialPresence["priority"] != 'undefined') ? initialPresence["priority"] : 1;
+				ownPresence.show = (initialPresence && initialPresence["show"]) ? initialPresence["show"] : "avail";
+				ownPresence.status = (initialPresence && typeof initialPresence["status"] != 'undefined') ? initialPresence["status"] : "Using Z-XMPP";
+				ownPresence.priority = (initialPresence && typeof initialPresence["priority"] != 'undefined') ? initialPresence["priority"] : 1;
 			}
 
 			// send initial presence