@@ -75,7 +75,7 @@ public string Execute(params string[] args)
7575 throw new Exception ( $ "An element was selected to be executed upon but could not be found. Please ensure you have saved your designer and try again.") ;
7676 }
7777
78- var inputFiles = GetInputFiles ( eventHandlerElement ) ;
78+ var inputFiles = GetInputFiles ( applicationId , eventHandlerElement ) ;
7979 Logging . Log . Info ( $ "Context files included: { inputFiles . Count } files") ;
8080 Logging . Log . Debug ( $ "Files: { string . Join ( ", " , inputFiles . Select ( f => Path . GetFileName ( f . FilePath ) ) ) } ") ;
8181
@@ -532,7 +532,7 @@ await Assert.ThrowsAsync<NotFoundException>(
532532 return promptTemplate ;
533533 }
534534
535- private List < ICodebaseFile > GetInputFiles ( IElement eventHandlerElement )
535+ private List < ICodebaseFile > GetInputFiles ( string applicationId , IElement eventHandlerElement )
536536 {
537537 var filesProvider = _applicationConfigurationProvider . GeneratedFilesProvider ( ) ;
538538
@@ -544,7 +544,7 @@ private List<ICodebaseFile> GetInputFiles(IElement eventHandlerElement)
544544 var handlerContent = string . Join ( "\n " , handlerFiles . Select ( f => f . Content ) ) ;
545545
546546 // PRIMARY: Integration event message (the incoming message type)
547- if ( eventHandlerElement . TypeReference . ElementId != null )
547+ if ( eventHandlerElement . TypeReference ? . ElementId != null )
548548 {
549549 inputFiles . AddRange ( filesProvider . GetFilesForMetadata ( eventHandlerElement . TypeReference . Element ) ) ;
550550 }
@@ -584,7 +584,7 @@ private List<ICodebaseFile> GetInputFiles(IElement eventHandlerElement)
584584 foreach ( var messageTypeName in publishedMessageTypes )
585585 {
586586 // Try to find the message by scanning for matching elements in Services metadata
587- var allElements = _metadataManager . Services ( eventHandlerElement . Package . Id ) . Elements ;
587+ var allElements = _metadataManager . Services ( applicationId ) . Elements ;
588588 var messageElement = allElements . FirstOrDefault ( e => e . Name . Equals ( messageTypeName , StringComparison . Ordinal ) ) ;
589589 if ( messageElement != null )
590590 {
0 commit comments