Don't crash in wxOSXGetImageFromBundle() if the bundle is invalid
Just return a null image instead, as this function can be called when we don't have any bitmaps too -- as it happens in the Button::Bitmap unit test, for example.
This commit is contained in:
@@ -171,6 +171,9 @@ wxBitmapBundle wxBitmapBundle::FromResources(const wxString& name)
|
|||||||
|
|
||||||
WXImage wxOSXGetImageFromBundle(const wxBitmapBundle& bundle)
|
WXImage wxOSXGetImageFromBundle(const wxBitmapBundle& bundle)
|
||||||
{
|
{
|
||||||
|
if (!bundle.IsOk())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
WXImage image = bundle.GetImpl()->OSXGetImage();
|
WXImage image = bundle.GetImpl()->OSXGetImage();
|
||||||
|
|
||||||
if (image == 0)
|
if (image == 0)
|
||||||
|
Reference in New Issue
Block a user