frappe / books

Free Accounting Software
https://frappe.io/books
GNU Affero General Public License v3.0
2.68k stars 614 forks source link

[Bug] - Fix Type error in Colors.vue without default colors #837

Closed shahzadbinshahjahan closed 4 months ago

shahzadbinshahjahan commented 5 months ago

Issue

When adding a color field by customizing the form without specifying default values, Color.vue throws a Type error because it tries to find the color from an undefined colors array

Changes Made

Added a condition before the find call to return the value if there are no items in the colors array. Screenshot from 2024-02-02 18 23 29 Screenshot from 2024-02-02 18 21 44

Isaac-GC commented 4 months ago

Hi @shahzadbinshahjahan Can you fix the linting issue?

Should just be able to run yarn prettier --write src/components/Controls/Color.vue and be good

shahzadbinshahjahan commented 4 months ago

Hi @Isaac-GC, I have fixed the linting issue. Thank you for your help.