Skip to content

Commit

Permalink
fix - ensure default is something when config is blank
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed Jan 17, 2024
1 parent 2f431dc commit 5697311
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public IEnumerable<LinkedPageInfo> CreateLink(int parent, int child)

if (parentNode == null || childNode == null)
throw new KeyNotFoundException();
var typeAlias = _config.RelationType ?? defaultRelationType;
var typeAlias = string.IsNullOrWhiteSpace(_config.RelationType) ?
defaultRelationType : _config.RelationType;
var relationType = _relationService.GetRelationTypeByAlias(typeAlias);
if (relationType == null)
throw new ApplicationException($"Cannot create relation of type {typeAlias}");
Expand Down

0 comments on commit 5697311

Please sign in to comment.