Added a NULL pointer check to zip_bus_speed().

This commit is contained in:
OBattler
2020-01-14 19:18:18 +01:00
committed by GitHub
parent 1b7da93aa3
commit c7cfc06285

View File

@@ -859,7 +859,7 @@ zip_bus_speed(zip_t *dev)
{
double ret = -1.0;
if (dev->drv->bus_type == ZIP_BUS_SCSI) {
if (dev && dev->drv && dev->drv->bus_type == ZIP_BUS_SCSI) {
dev->callback = -1.0; /* Speed depends on SCSI controller */
return 0.0;
} else {