--- websocket.tcl	2018-06-05 07:27:52.000000000 -0400
+++ websocket_patched.tcl	2018-06-05 07:30:51.000000000 -0400
@@ -117,7 +117,7 @@
     set varname [namespace current]::Connection_$sock
     upvar \#0 $varname Connection
 
-    if { $Connection(liveness) ne "" } {
+    if { [info exists Connection(liveness)] && $Connection(liveness) ne "" } {
 	after cancel $Connection(liveness)
     }
     Push $sock disconnect "Disconnected from remote end"
