ensureNotDestroyed(error) {
    if (this.destroyed_) {
      if (error instanceof shaka.util.Error &&
          error.code == shaka.util.Error.Code.OBJECT_DESTROYED) {
        throw error;
      }
      throw shaka.util.Destroyer.destroyedError(error);
    }
  }
Checks if the object is destroyed and throws an error if it is.
@param {*=} error The inner error, if any.