From 2833c86d59e98fc9e1491c2ba536bdc0e7260c67 Mon Sep 17 00:00:00 2001 From: Cameron Roe Date: Tue, 27 Jul 2021 12:47:03 -0500 Subject: [PATCH] Fix infinite loop when unable to re-open device after activating QT config --- screencapture/activator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screencapture/activator.go b/screencapture/activator.go index 2a18de5..3d395e7 100644 --- a/screencapture/activator.go +++ b/screencapture/activator.go @@ -40,14 +40,14 @@ func EnableQTConfig(device IosDevice) (IosDevice, error) { device, err = device.ReOpen(ctx) if err != nil { log.Debugf("device not found:%s", err) - continue + } else { + break } i++ if i > 10 { log.Debug("Failed activating config") return IosDevice{}, fmt.Errorf("could not activate Quicktime Config for %s", usbSerial) } - break } log.Debugf("QTConfig for %s activated", usbSerial) return device, err