Skip to content

Commit

Permalink
Merge pull request #698 from unicef/planned-visits-console-error
Browse files Browse the repository at this point in the history
Fix planned visits console error
  • Loading branch information
adi130987 authored Feb 14, 2018
2 parents 9bffd50 + 895897a commit 68fe96b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<paper-icon-button class="action delete"
on-tap="_openDeleteConfirmation"
data-args$="[[index]]"
disabled="[[!_canBeRemoved(index, editMode, item.id)]]"
disabled="[[!_canBeRemoved(index, editMode)]]"
icon="cancel">
</paper-icon-button>
</div>
Expand Down Expand Up @@ -186,7 +186,7 @@
* The planned visit row data can be removed only if it doesn't have and id assigned(only if is not saved)
*/
_canBeRemoved: function(index, editMode) {
if (!editMode) {
if (!editMode || !this.dataItems || !this.dataItems.length) {
return false;
}
var plannedVisit = this.dataItems[index];
Expand Down

0 comments on commit 68fe96b

Please sign in to comment.