Skip to content

Commit

Permalink
adding validation for empty args
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mrojas committed Sep 27, 2024
1 parent dda6b50 commit c98466e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extras/sfutils/sfutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def load_args(self,args):
self.args = {}
if isinstance(args,str):
args = args.split(' ')
if len(args)==1:
if len(args)==1 and args[0]:
try:
json_string = base64.b64decode(args[0]).decode('utf-8')
self.args = json.loads(json_string)
st.session_state["args"] = self.args
return
except Exception as ex:
logging.error("Failed to load args from base64 encoded string: {args[0]}", ex)
print("Failed to load args from base64 encoded string: {args[0]}", ex)
# ignore and continue
for i,arg in enumerate(args):
if "=" in arg:
Expand Down

0 comments on commit c98466e

Please sign in to comment.