Browse Source

refactoring

Daniel Gatis 2 years ago
parent
commit
dc45a477b2
1 changed files with 5 additions and 4 deletions
  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:
     def im_without_bg(content: bytes, commons: CommonQueryParams) -> Response:
         kwargs = dict()
         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(
         return Response(
             remove(
             remove(