summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-04-06 12:23:58 +0200
committerGitHub <noreply@github.com>2024-04-06 12:23:58 +0200
commit5db96406dd142b9a84d459ab45a10465bdb61740 (patch)
treeeb7d4844047d6bd8560aa4032a6f3cf9f5cb82ec /g4f/gui/server
parentUpdate client.md (diff)
parentUpdate README.md (diff)
downloadgpt4free-5db96406dd142b9a84d459ab45a10465bdb61740.tar
gpt4free-5db96406dd142b9a84d459ab45a10465bdb61740.tar.gz
gpt4free-5db96406dd142b9a84d459ab45a10465bdb61740.tar.bz2
gpt4free-5db96406dd142b9a84d459ab45a10465bdb61740.tar.lz
gpt4free-5db96406dd142b9a84d459ab45a10465bdb61740.tar.xz
gpt4free-5db96406dd142b9a84d459ab45a10465bdb61740.tar.zst
gpt4free-5db96406dd142b9a84d459ab45a10465bdb61740.zip
Diffstat (limited to 'g4f/gui/server')
-rw-r--r--g4f/gui/server/api.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py
index 747d0c21..ab9ad331 100644
--- a/g4f/gui/server/api.py
+++ b/g4f/gui/server/api.py
@@ -136,8 +136,8 @@ class Api():
camera.take_picture(filename=filename, on_complete=self.on_camera)
def on_image_selection(self, filename):
- filename = filename[0] if isinstance(filename, list) else filename
- if filename is not None and os.path.exists(filename):
+ filename = filename[0] if isinstance(filename, list) and filename else filename
+ if filename and os.path.exists(filename):
self.image = filename
else:
self.image = None