[PR #1598] [CLOSED] fix(text_embedding): guard against NoneType iterables (fixes #1595) #1978

Closed
opened 2026-02-16 11:15:46 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/1598
Author: @Hay0666
Created: 8/27/2025
Status: Closed

Base: mainHead: fix/openai_api_compatible-none-iterable


📝 Commits (1)

  • 902c981 Fix NoneType iterable bug in text_embedding.py

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 models/openai_api_compatible/models/text_embedding/text_embedding.py (+1 -0)

📄 Description

Related Issues or Context

Fixes #1595 – Prevents the PluginInvokeError when credentials is None in text_embedding.py.
Fixes https://github.com/langgenius/dify-official-plugins/issues/1595 – Prevents the PluginInvokeError when credentials is None in text_embedding.py.

This PR contains Changes to Non-Plugin

  • Documentation
  • Other (Bug Fix)

Changes Made

  • Added a defensive guard in text_embedding.py: credentials = credentials or {}.
  • Ensures iteration over credentials never fails if it's None.
  • No functional change; only prevents the TypeError crash.

Version Control

  • I have Bumped Up the Version in Manifest.yaml (not needed for this bug fix)

Environment Verification

  • Tested locally in a clean environment matching production configuration
  • Tested on SaaS environment

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-official-plugins/pull/1598 **Author:** [@Hay0666](https://github.com/Hay0666) **Created:** 8/27/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/openai_api_compatible-none-iterable` --- ### 📝 Commits (1) - [`902c981`](https://github.com/langgenius/dify-official-plugins/commit/902c981727e9e958881521c5acbdd071f6ba8a93) Fix NoneType iterable bug in text_embedding.py ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `models/openai_api_compatible/models/text_embedding/text_embedding.py` (+1 -0) </details> ### 📄 Description ## Related Issues or Context Fixes #1595 – Prevents the PluginInvokeError when `credentials` is None in text_embedding.py. Fixes https://github.com/langgenius/dify-official-plugins/issues/1595 – Prevents the PluginInvokeError when credentials is None in text_embedding.py. ## This PR contains Changes to *Non-Plugin* - [ ] Documentation - [x] Other (Bug Fix) ## Changes Made - Added a defensive guard in text_embedding.py: `credentials = credentials or {}`. - Ensures iteration over `credentials` never fails if it's None. - No functional change; only prevents the TypeError crash. ## Version Control - [ ] I have Bumped Up the Version in Manifest.yaml (not needed for this bug fix) ## Environment Verification - [x] Tested locally in a clean environment matching production configuration - [ ] Tested on SaaS environment --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 11:15:46 -05:00
yindo closed this issue 2026-02-16 11:15:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#1978