Skip to content

Commit

Permalink
check null in caption
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilad Gray committed Aug 20, 2018
1 parent d4abdb7 commit db61020
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/datetime/src/datePickerCaption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export class DatePickerCaption extends React.PureComponent<IDatePickerCaptionPro
Classes.DATEPICKER_CAPTION_MEASURE,
this.containerElement,
);
const monthSelectWidth = this.containerElement.firstElementChild.clientWidth;
const monthSelectWidth =
this.containerElement == null ? 0 : this.containerElement.firstElementChild.clientWidth;
const rightOffset = Math.max(2, monthSelectWidth - monthTextWidth - Icon.SIZE_STANDARD - 2);
this.setState({ monthRightOffset: rightOffset });
}
Expand Down

1 comment on commit db61020

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check null in caption

Preview: documentation | landing | table

Please sign in to comment.