cc.Texture2D - initWithData broken

Hi!

I have a custom component who extends from cc.Sprite to render a generated texture based on some colors defined in the Editor. For this I was using the initWithData(data, format, width, heigth) method from the cc.Texture2D class. I was working with Cocos Creator 1.9.x and now I have upgrade to 2.0.2. After the upgrade my Component have stopped working with the following error:

failed to set property bg<Quad> to [object Object] at bottomRight, TypeError: Cannot read property 'update' of null
at cc_Texture2D.update (/Applications/CocosCreator.app/Contents/Resources/engine/bin/.cache/dev/cocos2d/core/assets/CCTexture2D.js:178:38)
at cc_Texture2D.initWithData (/Applications/CocosCreator.app/Contents/Resources/engine/bin/.cache/dev/cocos2d/core/assets/CCTexture2D.js:205:22)
at Quad.generateTexture (/Users/mauricio/Documents/GMR-repos/covette/covette-creator/covet-creator/temp/quick-scripts/assets/scripts/components/Quad.js:135:20)

After a quick look into the Texture2D class, the initWithData method is trying to update the Texture2D, doing that is trying update the this._texture variable who hasn’t been initialized yet, but this variable is only being initialized on the handleLoadedTexture method, who is being called only by the initWithElement method of the Texture2D class…

Texture2D     
        initWithData: function initWithData(data, pixelFormat, pixelsWidth, pixelsHeight) {
                var opts = _getSharedOptions();
                opts.image = data;
                opts.format = pixelFormat;
                opts.width = pixelsWidth;
                opts.height = pixelsHeight;
                this.update(opts); //HERE THE UPDATE METHOD IS BEING CALLED
                this.width = pixelsWidth;
                this.height = pixelsHeight;
                this.loaded = true;
                this.emit('load'); 
                return true;
            },

Texture2D update method

update: function update(options) {
                if (options) {
                    var updateImg = false;
                    if (options.width !== undefined) {
                        this.width = options.width;
                    }
                    .....................
                    if (options.images && options.images.length > 0) {
                        //HERE THIS VARIABLE IS TRYING TO BE USED BUT IS NULL         
                        this._texture.update(options); 
                    }
                }
            },

There is a null check on update method missing?

I’m doing something wrong when initializing the Sprite with initWithData method? Do I need to do something before that?

Regards,