I decided to open up a 1.8 testworld of mine where I've been playing around with villagers are hopper minecarts. I tried to get some more villagers to farm but I didnt get any villagers called "farmer" so I headed to an old farm of mine and checked their names. 2 of the 5 villagers in there didn't have trades, and like 5 tabs open. (so all completely empty, see screenshot)
Opening their trading GUI was fine, however after a little bit, this time seems to be random, my game crashed. It happened 2 times and I think I reopened their GUI around 10 times.
All villagers were farmers.
I had more villagers in other locations in the world.
I'm not entirely sure whats going on here, and it might be hard to reproduce but the bug here is the villagers losing their trades, not the crash because they have no trades (or they are both a bug)
PS Sorry for the long story, I hope its not a waste of time.