message: fix(core): Add guard against scope.getAttachments
  We need to check for the existence of `finalScope.getAttachments` because `getAttachments` can be undefined if users are using an older version of `@sentry/core` that does not have the `getAttachments` method.
diff: @@ -437,7 +437,12 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
  // This should be the last thing called, since we want that
  // {@link Hub.addEventProcessor} gets the finished prepared event.
  - if (finalScope) {
  + //
  + // We need to check for the existence of `finalScope.getAttachments`
  + // because `getAttachments` can be undefined if users are using an older version
  + // of `@sentry/core` that does not have the `getAttachments` method.
  + // See: https://github.com/getsentry/sentry-javascript/issues/5229
  + if (finalScope && finalScope.getAttachments) {
  // Collect attachments from the hint and scope
  const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()];
  