1 (edited by bp10719 2017-03-27 21:56:17)

Topic: Exception thrown in OnlineMapsDrawingElement because null "gameobject"

There is an issue with the OnlineMapsDrawingElement class that causes an exception in the "active" property.

The "gameobject" that SetActive is being called on could be null, and there is no null check. This null check was in place in the previous version of the tool that we were using, but is no longer there when we upgraded to build 2.5.4.1.

This occurs if an OnlineMapsDrawingRect is created, and then has its "visible" property set to false.
If this happens the method InitMesh() is never called for the drawing element, and the gameobject is never set, and it remains null, and causes issues later.

We fixed this issue by adding the null check back in the "active" property.

So:

    protected virtual bool active
    {
        get
        {
            return gameObject.activeSelf;
        }
        set
        {
            if (gameObject)
            {
                gameObject.SetActive(value);
            }
        }
    }

Re: Exception thrown in OnlineMapsDrawingElement because null "gameobject"

Hello.

Thank you for bug report.
The bug is fixed.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.