Skip to content

Commit 10bd6d7

Browse files
committed
SchemaEditor: some extra loop protection to enable empty schemas to be loaded.
1 parent c762b81 commit 10bd6d7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/AppContext.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ export default class AppContext {
399399
// .inherits[enum1 name, enum2 name, ... , this enum], merging each in order
400400
// such that permissible value labels, descriptions and mappings can be
401401
// overwritten. See https://linkml.io/linkml-model/latest/docs/inherits/
402-
Object.entries(schema.enums).forEach(([enum_name, enum_obj]) => {
402+
Object.entries(schema.enums || {}).forEach(([enum_name, enum_obj]) => {
403403
if (enum_obj.inherits) {
404404
const values = {};
405405
enum_obj.inherits.forEach(inherit_enum_name => {
@@ -1545,7 +1545,7 @@ export default class AppContext {
15451545
});
15461546

15471547
// For each dependent
1548-
this.relations[start_name].dependents.keys().forEach((class_name) => {
1548+
this.relations[start_name]?.dependents?.keys().forEach((class_name) => {
15491549
// 1) Assemble the needed key_vals for this start class and its
15501550
// dependents (via foreign keys).
15511551
let [key_vals, fkey_vals, fkey_status] =

0 commit comments

Comments
 (0)