diff --git a/src/TelescopeSourceGenerator/Analyzers/TelescopeIncrementalGenerator.cs b/src/TelescopeSourceGenerator/Analyzers/TelescopeIncrementalGenerator.cs index e737bdf..8a59053 100644 --- a/src/TelescopeSourceGenerator/Analyzers/TelescopeIncrementalGenerator.cs +++ b/src/TelescopeSourceGenerator/Analyzers/TelescopeIncrementalGenerator.cs @@ -97,7 +97,10 @@ public void Initialize(IncrementalGeneratorInitializationContext context) context.RegisterSourceOutput(generatedCodeProvider, (sourceProductionContext, generatedCode) => { - sourceProductionContext.AddSource("__AttributedTypesExport__", generatedCode); + if(!string.IsNullOrEmpty(generatedCode)) + { + sourceProductionContext.AddSource("__AttributedTypesExport__", generatedCode); + } }); }