Don't crash if there's no m_image yet.

Reproducible with:
    QBackingStore store( &window );
    store.beginPaint(QRect(0,0,500,500));

All other methods already have null pointer checks.

Change-Id: Ie278a263760900b58cf4a2ef286deb7f35d50cd0
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
Sérgio Martins 2012-10-22 00:55:04 +01:00 committed by The Qt Project
parent 92c739cf50
commit 6e908f09df

View File

@ -262,11 +262,14 @@ QXcbBackingStore::~QXcbBackingStore()
QPaintDevice *QXcbBackingStore::paintDevice() QPaintDevice *QXcbBackingStore::paintDevice()
{ {
return m_image->image(); return m_image ? m_image->image() : 0;
} }
void QXcbBackingStore::beginPaint(const QRegion &region) void QXcbBackingStore::beginPaint(const QRegion &region)
{ {
if (!m_image)
return;
m_image->preparePaint(region); m_image->preparePaint(region);
#if 0 #if 0