Fix crash when there's no connection.