# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1284385770 -3600
# Node ID b3839716373753b7fe754806957dbc08327f28dd
# Parent  1c30dd51ca6b8bcd790fb7c3b77b8cdc8af9f0d5
verse: Log error and return when trying to close a closed connection

diff -r 1c30dd51ca6b -r b38397163737 init.lua
--- a/init.lua	Mon Sep 13 14:48:10 2010 +0100
+++ b/init.lua	Mon Sep 13 14:49:30 2010 +0100
@@ -83,6 +83,10 @@
 end
 
 function stream:close()
+	if not self.conn then 
+		verse.log("error", "Attempt to close disconnected connection - possibly a bug");
+		return;
+	end
 	local on_disconnect = self.conn.disconnect();
 	self.conn:close();
 	on_disconnect(conn, reason);