Add check to avoid undefined value

This commit is contained in:
Joao Victor 2022-01-24 14:52:24 -03:00
parent 7a733b7382
commit 6b90f571e7

View File

@ -166,7 +166,11 @@ class Presentation extends PureComponent {
this.onResize();
}
if (currentSlide.num !== prevProps.currentSlide.num) {
if (
currentSlide?.num != null &&
prevProps?.currentSlide?.num != null &&
currentSlide?.num !== prevProps.currentSlide?.num
) {
politeSRAlert(intl.formatMessage(intlMessages.slideContentChanged, { 0: currentSlide.num }));
}