diff --git a/frontend/src/components/dialog/edit-filetag-dialog.js b/frontend/src/components/dialog/edit-filetag-dialog.js
index 6dc5709c42..14114fa83d 100644
--- a/frontend/src/components/dialog/edit-filetag-dialog.js
+++ b/frontend/src/components/dialog/edit-filetag-dialog.js
@@ -40,7 +40,7 @@ class TagItem extends React.Component {
getRepoTagIdList = () => {
let repoTagIdList = [];
- let fileTagList = this.props.fileTagList;
+ let fileTagList = this.props.fileTagList || [];
repoTagIdList = fileTagList.map((fileTag) => fileTag.repo_tag_id);
return repoTagIdList;
}
diff --git a/frontend/src/components/dirent-detail/detail-list-view.js b/frontend/src/components/dirent-detail/detail-list-view.js
index 5afeb07f55..28461174d1 100644
--- a/frontend/src/components/dirent-detail/detail-list-view.js
+++ b/frontend/src/components/dirent-detail/detail-list-view.js
@@ -94,7 +94,7 @@ class DetailListView extends React.Component {
{gettext('Tags')} |
- {fileTagList.map((fileTag) => {
+ {Array.isArray(fileTagList) && fileTagList.map((fileTag) => {
return (
-
@@ -142,6 +142,10 @@ class DetailListView extends React.Component {
}
}
+DetailListView.defaultProps = {
+ fileTagList: [],
+};
+
DetailListView.propTypes = propTypes;
export default DetailListView;
diff --git a/frontend/src/components/dirent-detail/file-details.js b/frontend/src/components/dirent-detail/file-details.js
index ad778375f3..67947a5721 100644
--- a/frontend/src/components/dirent-detail/file-details.js
+++ b/frontend/src/components/dirent-detail/file-details.js
@@ -85,7 +85,7 @@ class FileDetails extends React.Component {
{gettext('Tags')} |
- {fileTagList.map((fileTag) => {
+ {Array.isArray(fileTagList) && fileTagList.map((fileTag) => {
return (
-
diff --git a/frontend/src/pages/markdown-editor/rich-markdown-editor/detail-list-view.js b/frontend/src/pages/markdown-editor/rich-markdown-editor/detail-list-view.js
index 9ed54d18dc..863d70ee58 100644
--- a/frontend/src/pages/markdown-editor/rich-markdown-editor/detail-list-view.js
+++ b/frontend/src/pages/markdown-editor/rich-markdown-editor/detail-list-view.js
@@ -46,7 +46,7 @@ class DetailListView extends React.Component {
{gettext('Tags')} |
- {fileTagList.map((fileTag) => {
+ {Array.isArray(fileTagList) && fileTagList.map((fileTag) => {
return (
-
@@ -75,6 +75,10 @@ class DetailListView extends React.Component {
}
}
+DetailListView.defaultProps = {
+ fileTagList: [],
+};
+
DetailListView.propTypes = propTypes;
export default DetailListView;
| | |