saleor/saleor

TypeError: 'NoneType' object is not iterable

Open

#17 891 ouverte le 30 juin 2025

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)Python (19 887 stars) (5 278 forks)batch import
bughelp wanted

Description

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

Guide contributeur