It appears that the Android 5.1 update is not as good and bug-repelling for everyone as more Nexus 5 users discovered frequent camera crashes recently. It appears that, ever since the 5.1 update, activating the camera on a Nexus 5 has become a chore that ends in a crash every time.
This happens when the stock app or other pieces of software attempts to access the camera, some of the most used such apps being Snapchat and Facebook or Instagram. This problem is also affecting Smart Unlock, it appears. A bug report has already been filled and a possible problem was identified.
The problem does not occur every time the Camera feature is activated as sometimes it works again after a restart. Even if this does happen, be assured that your phone is not fixed and a crash will occur again, at least until the bug is properly fixed.
We can only wait and hope for a fast fix for this camera crash nuisance.