away3d / away3d-core-fp11

Away3D engine for Flash Player 11
http://www.away3d.com
Other
640 stars 273 forks source link

Mouse3DManager throw null when we back from right click menu #602

Closed bartek5186 closed 10 years ago

bartek5186 commented 11 years ago

Reproduction: 1.On clear project, when we create view3D with camera and add to displayobject. 2.Click right mouse button and turn on contextual menu

  1. After that click to display stage, contextual menu should turn off
  2. Throwed Exception from MouseManager3D (line 59): Cannot access a property or method of a null object reference.

To prevent this add if(_collidingObject) in MouseManager3D.as (line 59) before checking that mousePicker have it

public function updateCollider(view : View3D) : void
        {
            _previousCollidingObject = _collidingObject;

            if (view == _activeView && (_forceMouseMove || _updateDirty)) { // If forceMouseMove is off, and no 2D mouse events dirtied the update, don't update either.
//add checking is collidingObject exists                
if(_collidingObject) _collidingObject = _mousePicker.getViewCollision(view.mouseX, view.mouseY, view);
            }

            _updateDirty = false;
        }
rob-bateman commented 10 years ago

duplicate of #601