Check if ffmpeg open was successful before reading image frame (#17)
Check if ffmpeg open was successful before reading image frame (#17)

HAFFmpeg open can fail in case FFmpeg fails, so check for self._proc
before using it to read the image frame.

Fixes:

File "/usr/lib/python3.6/site-packages/haffmpeg/tools.py", line 82, in get_image
    self._proc.communicate(), loop=self._loop)
AttributeError: 'NoneType' object has no attribute 'communicate'

Signed-off-by: Ricardo Salveti <70438f6c19109abcad91caff56a33a6380331d15@rsalveti.net>
pvizeli/ha-ffmpeg