From f07a4428603000556f9742caf3baa41b9ec6733a Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Fri, 11 Mar 2016 11:35:31 +0000 Subject: [PATCH] mraa.c: Fix pin mode test to check for NULL platform Signed-off-by: Brendan Le Foll --- src/mraa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mraa.c b/src/mraa.c index 77b4bf6..f17f3ae 100644 --- a/src/mraa.c +++ b/src/mraa.c @@ -497,7 +497,7 @@ mraa_pin_mode_test(int pin, mraa_pinmodes_t mode) pin = mraa_get_sub_platform_index(pin); } - if (current_plat == NULL || current_plat->platform_type == MRAA_UNKNOWN_PLATFORM) { + if (current_plat == NULL || current_plat->platform_type == MRAA_UNKNOWN_PLATFORM || current_plat->platform_type == MRAA_NULL_PLATFORM) { return 0; } if (pin > (current_plat->phy_pin_count - 1) || pin < 0)