Notice on not existsing $modx->resource

When we do $modx->sendForward() on OnPageNotFound, $modx->resource does not exists.