Diff

core/s2smanager.lua @ 938:663f75dd7b42

Fixed: Some nil access bugs
author Waqas Hussain <waqas20@gmail.com>
date Mon, 30 Mar 2009 05:26:10 +0500
parent 931:4514ed5ee943
child 959:e3db909065f2
line wrap: on
line diff
--- a/core/s2smanager.lua	Mon Mar 30 04:39:12 2009 +0500
+++ b/core/s2smanager.lua	Mon Mar 30 05:26:10 2009 +0500
@@ -212,8 +212,8 @@
 	
 	if session.direction == "incoming" then
 		-- Send a reply stream header
-		session.to_host = nameprep(attr.to);
-		session.from_host = nameprep(attr.from);
+		session.to_host = attr.to and nameprep(attr.to);
+		session.from_host = attr.from and nameprep(attr.from);
 	
 		session.streamid = uuid_gen();
 		(session.log or log)("debug", "incoming s2s received <stream:stream>");