diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm index a3709b5bb..ddfc53436 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Trigger/Channel/Serial.pm @@ -58,6 +58,12 @@ sub open { my $self = shift; my $device = new Device::SerialPort( $self->{path} ); + if ( ! $device ) + { + Error( "Unable to open $$self{path}: $!" ); + $self->{state} = 'closed'; + return; + } $device->baudrate(9600); $device->databits(8); $device->parity('none');