resolve #2 fix NullPointer when opening view

- add boundary check for view documents enumeration.