fix: Javascript "is undefined" error (#2266)
Make Chart of Accounts Javascript run without error when no accounts exist Fixes: WEB-10
This commit is contained in:
@@ -59,6 +59,10 @@ export class GlAccountTreeService {
|
||||
new GLAccountNode(this.translateService.instant('labels.inputs.accounting.LIABILITY'))
|
||||
);
|
||||
|
||||
if (glAccountData.length === 0) {
|
||||
return glAccountTree;
|
||||
}
|
||||
|
||||
// Sort by parent id (so that child nodes can be added properly)
|
||||
if (!glAccountData[0].parentId) {
|
||||
glAccountData[0].parentId = 0;
|
||||
|
||||
Reference in New Issue
Block a user