[JENKINS-60092] getPrimaryView: return null if no view is defined (cherry picked from commit 8bc435f3)