views: protect when koDoc is null

(integrated from master branch change b047676 by Todd Whiteman <toddw@activestate.com>)