Fix last label undefined

This commit is contained in:
justinr1234 2019-08-26 12:16:21 -05:00 committed by GitHub
parent 7cffce972d
commit 0cf9a7b552
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,7 @@ BlazeComponent.extendComponent({
const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById(
lastLabelId,
);
if (lastLabel.name === undefined || lastLabel.name === '') {
if (lastLabel && (lastLabel.name === undefined || lastLabel.name === '')) {
return lastLabel.color;
} else {
return lastLabel.name;