Add explicit guards to all device mode tasks to ensure the device is connected and...
[pub/lufa.git] / LUFA / Drivers / USB / Class / Device / MassStorage.c
index 9d73989..ceb4b96 100644 (file)
@@ -96,7 +96,7 @@ bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
 \r
 void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
 {\r
-       if (!(USB_IsConnected))\r
+       if (!(USB_IsConnected) || !(USB_ConfigurationNumber))\r
          return;\r
 \r
        Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);\r