Skip to content

Commit

Permalink
Merge pull request #407 from tridz-dev/develop
Browse files Browse the repository at this point in the history
Fix: Add null check for Select field options in fields_layout
  • Loading branch information
shariquerik authored Oct 11, 2024
2 parents cf82757 + fbab391 commit 83d5b33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crm/fcrm/doctype/crm_fields_layout/crm_fields_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_fields_layout(doctype: str, type: str):
for field in section.get("fields") if section.get("fields") else []:
field = next((f for f in fields if f.fieldname == field), None)
if field:
if field.fieldtype == "Select":
if field.fieldtype == "Select" and field.options:
field.options = field.options.split("\n")
field.options = [{"label": _(option), "value": option} for option in field.options]
field.options.insert(0, {"label": "", "value": ""})
Expand Down

0 comments on commit 83d5b33

Please sign in to comment.