So this is a common problem on the Lenovo ThinkPad W540 and W541 laptops. A bad webcam driver from Windows updates causes the laptop to blue screen immediately if the webcam is put to use. The trick is to go to the device manager uninstall and delete the webcam drivers. After an error message and a reboot the webcam will work properly. As long as you don't reinstall the webcam drivers through Windows update everything should be fine.
...
https://www.youtube.com/watch?v=Swild8ZfXeU