         if (_camera == null) {
             return;
         }
-        if (_bitmap.parent != null) {
+        if (_bitmap != null && _bitmap.parent != null) {
             removeChild(_bitmap);
         }
-        if (_video.parent == null) {
+        if (_video != null && _video.parent == null) {
             addChild(_video);
         }
     }

            detachVideo();
        }

        _camera = camera;
        if (_camera == null) {
            return;
        }

        attachVideo();
    }

    public function getCameraName () :String

    protected var _video :Video;

    protected var _bitmap :Bitmap;

    protected var _correctionWidth :int;

    protected var _correctionHeight :int;
}
}
