From d8ff5b1effe0db563defc2a6e1391b9b0d160e67 Mon Sep 17 00:00:00 2001
From: bob <bcz@cs.brown.edu>
Date: Tue, 29 Jan 2019 14:43:42 -0500
Subject: intermediate state -- things don't resize properly yet.

---
 src/views/collections/CollectionDockingView.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/views/collections/CollectionDockingView.tsx')

diff --git a/src/views/collections/CollectionDockingView.tsx b/src/views/collections/CollectionDockingView.tsx
index b6fff6ba0..a59a40b33 100644
--- a/src/views/collections/CollectionDockingView.tsx
+++ b/src/views/collections/CollectionDockingView.tsx
@@ -132,13 +132,13 @@ export class CollectionDockingView extends React.Component<CollectionViewProps>
         console.log("Gettting " + component);
         const { fieldKey, Document: Document } = this.props;
         const value: Document[] = Document.GetFieldValue(fieldKey, ListField, []);
-        if (component === "doc1") {
+        if (component === "doc1" && value.length > 0) {
             return (<DocumentView key={value[ 0 ].Id} ContainingCollectionView={this} Document={value[ 0 ]} ContainingDocumentView={this.props.ContainingDocumentView} />);
         }
-        if (component === "doc2") {
+        if (component === "doc2" && value.length > 1) {
             return (<DocumentView key={value[ 1 ].Id} ContainingCollectionView={this} Document={value[ 1 ]} ContainingDocumentView={this.props.ContainingDocumentView} />);
         }
-        if (component === "doc3") {
+        if (component === "doc3" && value.length > 2) {
             return (<DocumentView key={value[ 2 ].Id} ContainingCollectionView={this} Document={value[ 2 ]} ContainingDocumentView={this.props.ContainingDocumentView} />);
         }
         if (component === "text") {
-- 
cgit v1.2.3-70-g09d2

