From 602793dcd04cdfa261c4316005e02b3928ca332b Mon Sep 17 00:00:00 2001 From: jykim Date: Tue, 9 Jan 2018 11:30:35 +0900 Subject: [PATCH] Add null check code --- src/darwin_list.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/darwin_list.cpp b/src/darwin_list.cpp index f793760..f3d516f 100644 --- a/src/darwin_list.cpp +++ b/src/darwin_list.cpp @@ -281,7 +281,7 @@ void EIO_List(uv_work_t* req) { } stDeviceListItem* devices = GetSerialDevices(); - if (*(devices->length) > 0) { + if (devices != NULL && *(devices->length) > 0) { stDeviceListItem* next = devices; for (int i = 0, len = *(devices->length); i < len; i++) {