Commit 0e6cb75ad1ffa3f168180fc8cf981b1146e86c3d
Exists in
master
Merge branch 'bug/prop_type_#223'
Fixes #223
Showing
1 changed file
Show diff stats
imports/ui/pages/ViewDocument.js
... | ... | @@ -24,7 +24,7 @@ const handleRemove = (_id) => { |
24 | 24 | const ViewDocument = ({ doc }) => ( |
25 | 25 | <div className="ViewDocument"> |
26 | 26 | <div className="page-header clearfix"> |
27 | - <h4 className="pull-left">{ doc.title }</h4> | |
27 | + <h4 className="pull-left">{ doc && doc.title }</h4> | |
28 | 28 | <ButtonToolbar className="pull-right"> |
29 | 29 | <ButtonGroup bsSize="small"> |
30 | 30 | <Button onClick={ () => handleEdit(doc._id) }>Edit</Button> |
... | ... | @@ -32,12 +32,12 @@ const ViewDocument = ({ doc }) => ( |
32 | 32 | </ButtonGroup> |
33 | 33 | </ButtonToolbar> |
34 | 34 | </div> |
35 | - { doc.body } | |
35 | + { doc && doc.body } | |
36 | 36 | </div> |
37 | 37 | ); |
38 | 38 | |
39 | 39 | ViewDocument.propTypes = { |
40 | - doc: React.PropTypes.object.isRequired, | |
40 | + doc: React.PropTypes.object, | |
41 | 41 | }; |
42 | 42 | |
43 | 43 | export default ViewDocument; | ... | ... |