]> sigrok.org Git - libsigrok.git/commitdiff
sr: extra checks for properly handling driverless devices
authorBert Vermeulen <redacted>
Sun, 29 Jul 2012 00:15:34 +0000 (02:15 +0200)
committerBert Vermeulen <redacted>
Sun, 29 Jul 2012 00:16:17 +0000 (02:16 +0200)
session.c

index 51dce2e4f9aad41d00b85d421206794a613f971b..92ee648a631c77d41092beb3bf010f00c5537d30 100644 (file)
--- a/session.c
+++ b/session.c
@@ -88,7 +88,7 @@ SR_API int sr_session_destroy(void)
 
 static void sr_dev_close(struct sr_dev *dev)
 {
-       if (dev->driver->dev_close)
+       if (dev && dev->driver && dev->driver->dev_close)
                dev->driver->dev_close(dev->driver_index);
 }