Fix crash when there is only one view and a widget

2 jobs for master in 3 minutes and 46 seconds (queued for 2 seconds)