saleor/saleor

TypeError: 'NoneType' object is not iterable

Open

#17,891 创建于 2025年6月30日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Python (19,887 star) (5,278 fork)batch import
bughelp wanted

描述

There is an issue when the webhook doesn't respond, and the paymentGatewayInitialize mutation receives the following variables in the prepare_response method:

payment_gateways_input = [PaymentGatewayData(app_identifier='saleor.app.payment.stripe', data=None, error=None)]
payment_gateways_response = None

This results in the mutation failing with the following exception:

TypeError: 'NoneType' object is not iterable
(1 additional frame(s) were not displayed)
...
  File "saleor/graphql/core/mutations.py", line 521, in mutate
    response = cls.perform_mutation(root, info, **data)
  File "saleor/graphql/payment/mutations/transaction/payment_gateway_initialize.py", line 149, in perform_mutation
    gateway_configs=cls.prepare_response(payment_gateways_data, response_data),
  File "saleor/graphql/payment/mutations/transaction/payment_gateway_initialize.py", line 81, in prepare_response
    gateway.app_identifier: gateway for gateway in payment_gateways_response

A query failed unexpectedly

First seen in 3.22.0-a.0.

Internal Sentry issue: SALEOR-CORE-6GE

贡献者指南