Update keyset.rb

Fix bug with nil connection