The following command entered at the Python interactor of a newly opened Slicer crashes the program and the window closes:
camNode = slicer.modules.cameras.logic().GetViewActiveCameraNode(slicer.app.layoutManager.threeDWidget(1).mrmlViewNode())
This works fine if the view exists; for example
camNode = slicer.modules.cameras.logic().GetViewActiveCameraNode(layoutManager.threeDWidget(0).mrmlViewNode())
does not crash Slicer and just returns the camera node for 3D View 1. I discovered this bug when I accidentally forgot to subtract 1 from the view index and requested the camera node for a view which did not exist, and lost my work in Slicer up to that point since the last time I saved.