added check to make sure there is a connection to be drawn before attempting to actually draw it.