Make webcam handling more stable (fix possible NPE)