From 68051a9c41235e807c4d3149ff61b1451ce7818d Mon Sep 17 00:00:00 2001 From: OpenHTF Owners Date: Thu, 5 Oct 2023 18:02:33 -0700 Subject: [PATCH] Internal change. PiperOrigin-RevId: 571185985 --- openhtf/plugs/usb/fastboot_device.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openhtf/plugs/usb/fastboot_device.py b/openhtf/plugs/usb/fastboot_device.py index 47251bf60..ec53e30cc 100644 --- a/openhtf/plugs/usb/fastboot_device.py +++ b/openhtf/plugs/usb/fastboot_device.py @@ -51,6 +51,8 @@ def __init__(self, _, num_retries=3): @property def usb_handle(self): """Return our USB handle.""" + if not self._protocol: + raise usb_exceptions.HandleClosedError() return self._protocol.usb_handle def set_boot_config(self, name, value):