From ba4f37f106d5e02d547db7e567cd16964398ab06 Mon Sep 17 00:00:00 2001
From: shayo <shay.ohayon@gmail.com>
Date: Wed, 5 Feb 2014 23:10:14 -0800
Subject: [PATCH] Fixed minor bug in Pulse Pal

if no serial devices exist, adding Pulse pal caused a crash.
---
 Source/Processors/Serial/PulsePal.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Source/Processors/Serial/PulsePal.cpp b/Source/Processors/Serial/PulsePal.cpp
index d37947e51..1918fb87f 100644
--- a/Source/Processors/Serial/PulsePal.cpp
+++ b/Source/Processors/Serial/PulsePal.cpp
@@ -88,6 +88,11 @@ void PulsePal::initialize()
     vector<ofSerialDeviceInfo> devices = serial.getDeviceList();
 
    // bool foundDevice = false;
+	if (devices.size() == 0)
+	{
+		std::cout << "No serial devices found!" << std::endl;
+		return;
+	}
 
     int id = devices[0].getDeviceID();
         string path = devices[0].getDevicePath();
-- 
GitLab