CComponentsHeader: add missing check for null pointer

This commit is contained in:
2017-08-28 12:16:45 +02:00
parent d42389b167
commit 5221769840

View File

@@ -343,14 +343,18 @@ void CComponentsHeader::initLogo()
* with previous or next item. * with previous or next item.
*/ */
if (cch_caption_align & CC_TITLE_LEFT){ if (cch_caption_align & CC_TITLE_LEFT){
int left_tag = prev_item->getXPos() + prev_item->getWidth(); if (prev_item){
if (x_logo <= left_tag) int left_tag = prev_item->getXPos() + prev_item->getWidth();
x_logo = left_tag + logo_space/2 - w_logo/2; if (x_logo <= left_tag)
x_logo = left_tag + logo_space/2 - w_logo/2;
}
} }
if (cch_caption_align & CC_TITLE_RIGHT){ if (cch_caption_align & CC_TITLE_RIGHT){
if (x_logo + w_logo >= next_item->getXPos()) if (next_item){
x_logo = next_item->getXPos() - logo_space/2 - w_logo/2; if (x_logo + w_logo >= next_item->getXPos())
x_logo = next_item->getXPos() - logo_space/2 - w_logo/2;
}
} }
} }