Skip to content

Commit 8ddb41b

Browse files
committed
fix null ref during load
1 parent 71ac19c commit 8ddb41b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

HarmonyCoreCodeGen.Core/Model/Solution.dbl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ namespace HarmonyCoreGenerator.Model
13741374

13751375
data context = new CodeGenContext(taskSet)
13761376
context.ExtendedRepositoryProperties = GetExtendedStructureProperties()
1377-
1377+
13781378
;;compiler bug
13791379
;;context.Structures = new RpsStructureCollection(RpsLoadMode.Load, AlternateFieldNames ?? false)
13801380
;;internal compiler error
@@ -1383,6 +1383,9 @@ namespace HarmonyCoreGenerator.Model
13831383
if(AlternateFieldNames.HasValue)
13841384
altFieldNames = AlternateFieldNames.Value
13851385

1386+
if(context.Repository == ^null)
1387+
context.Repository = RPS
1388+
13861389
context.Structures = new RpsStructureCollection(context.Repository,RpsLoadMode.Load,altFieldNames)
13871390
context.Properties.TryAdd(^typeof(HarmonyCoreExtensions.Helpers.RelationLookup), new HarmonyCoreExtensions.Helpers.RelationLookup(context.Structures, loadedRelations))
13881391
;;create code generator

0 commit comments

Comments
 (0)