Skip to content
Snippets Groups Projects
Commit ac679921 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Exclude cases when length can be called on null or undefined

parent d5e11e27
Branches
Tags
2 merge requests!125WIP: Release/2.0.3,!121Fix blank reports page
Pipeline #24289 passed
......@@ -41,7 +41,7 @@
<span class="deactivated"> (deactivated)</span>
</span>
</div>
<div v-if="report.content.length > 0">
<div v-if="report.content && report.content.length > 0">
<el-divider class="divider"/>
<span class="report-row-key">{{ $t('reports.content') }}:
<span>{{ report.content }}</span>
......@@ -151,7 +151,7 @@ export default {
return 'primary'
}
},
getStatusesTitle(statuses) {
getStatusesTitle(statuses = []) {
return `Reported statuses: ${statuses.length} item(s)`
},
getNotesTitle(notes = []) {
......@@ -167,7 +167,7 @@ export default {
parseTimestamp(timestamp) {
return moment(timestamp).format('L HH:mm')
},
showStatuses(statuses) {
showStatuses(statuses = []) {
return statuses.length > 0
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment