Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4168a073 authored by Dees Troy's avatar Dees Troy
Browse files

Fix render issue when button has conditional

If the button has a conditional, the image render function will
return a 0 which indicated that an image was present even if it
was not if the condition was not being met during boot. When the
condition is met, mButtonImg was not set to NULL causing a render
request failure.

Change-Id: I32be0ddcdc1bf7ad22440d66018ef09484280afa
parent 995e88cf
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -58,16 +58,20 @@ GUIButton::GUIButton(xml_node<>* node)

	if (!node)  return;

	// Three of the four can be loaded directly from the node
	mButtonImg = new GUIImage(node);
	// These can be loaded directly from the node
	mButtonLabel = new GUIText(node);
	mAction = new GUIAction(node);

	child = node->first_node("image");
	if (child)
	{
		mButtonImg = new GUIImage(node);
		if (mButtonImg->Render() < 0)
		{
			delete mButtonImg;
			mButtonImg = NULL;
		}
	}
	if (mButtonLabel->Render() < 0)
	{
		delete mButtonLabel;