From 27bdb443b3abec5c41b724c5b0d566e9b70f4542 Mon Sep 17 00:00:00 2001 From: Adrian Serrano Date: Mon, 13 Nov 2017 22:13:56 -0800 Subject: [PATCH] Avoid assertion failure when using Host Device Passing a device ID of zero (Host device) to FSEventsCopyUUIDForDevice causes the following assertion failure error to be printed to the logs: (FSEvents.framework) FSEventsCopyUUIDForDevice(): failed assertion 'dev > 0' --- fsevents.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fsevents.go b/fsevents.go index 6ff0797..fd0bd86 100644 --- a/fsevents.go +++ b/fsevents.go @@ -158,7 +158,9 @@ func (es *EventStream) Start() { // in C callback cbInfo := registry.Add(es) es.registryID = cbInfo - es.uuid = GetDeviceUUID(es.Device) + if es.Device != 0 { + es.uuid = GetDeviceUUID(es.Device) + } es.start(es.Paths, cbInfo) }