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,16 +343,20 @@ void CComponentsHeader::initLogo()
* with previous or next item.
*/
if (cch_caption_align & CC_TITLE_LEFT){
if (prev_item){
int left_tag = prev_item->getXPos() + prev_item->getWidth();
if (x_logo <= left_tag)
x_logo = left_tag + logo_space/2 - w_logo/2;
}
}
if (cch_caption_align & CC_TITLE_RIGHT){
if (next_item){
if (x_logo + w_logo >= next_item->getXPos())
x_logo = next_item->getXPos() - logo_space/2 - w_logo/2;
}
}
}
/*
* Finally set logo x position