Fix slice bounds out of range panic when stopping Tello drone #631
Most of the time when stopping my DJI Tello drone, I was getting this panic:
I noticed the driver was trying to publish a VideoFrameEvent before checking for an error from the read UDP operation. This commit moves the error check to immediately after the read operation and continues if an error occurred. This avoids trying to slice an empty buffer and dodges a panic.
@@ Coverage Diff @@ ## dev #631 +/- ## ========================================== - Coverage 77.73% 77.72% -0.01% ========================================== Files 157 157 Lines 10672 10673 +1 ========================================== Hits 8296 8296 - Misses 1928 1929 +1 Partials 448 448