Daniel Gatis %!s(int64=2) %!d(string=hai) anos
pai
achega
dc45a477b2
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      rembg/commands/s_command.py

+ 5 - 4
rembg/commands/s_command.py

@@ -175,10 +175,11 @@ def s_command(port: int, log_level: str, threads: int) -> None:
     def im_without_bg(content: bytes, commons: CommonQueryParams) -> Response:
         kwargs = dict()
 
-        try:
-            kwargs.update(json.loads(commons.extras))
-        except Exception:
-            pass
+        if commons.extras:
+            try:
+                kwargs.update(json.loads(commons.extras))
+            except Exception:
+                pass
 
         return Response(
             remove(