saleor/saleor

TypeError: 'NoneType' object is not iterable

Ouverte

#17 891 ouverte le 30 juin 2025

 (3 commentaires) (0 réaction) (0 personne assignée)Python (5 278 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (19 887 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

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