@@ -379,7 +379,7 @@ function generateMessageInterfaces(formatter: TextFormatter, messageType: Protob
379
379
let usesLong: boolean = false;
380
380
let seenDeps: Set<string> = new Set<string>();
381
381
const childTypes = getChildMessagesAndEnums(messageType);
382
- formatter.writeLine(` // Original file: ${messageType.filename?.replace(/\\/g, '/')}`);
382
+ formatter.writeLine(` // Original file: ${( messageType.filename ?? 'null') ?.replace(/\\/g, '/')}`);
383
383
formatter . writeLine ( '' ) ;
384
384
messageType . fieldsArray . sort ( ( fieldA , fieldB ) => fieldA . id - fieldB . id ) ;
385
385
for ( const field of messageType . fieldsArray ) {
@@ -437,7 +437,7 @@ function generateMessageInterfaces(formatter: TextFormatter, messageType: Protob
437
437
}
438
438
439
439
function generateEnumInterface ( formatter : TextFormatter , enumType : Protobuf . Enum , options : GeneratorOptions , nameOverride ?: string ) {
440
- formatter . writeLine ( `// Original file: ${ enumType . filename ?. replace ( / \\ / g, '/' ) } ` ) ;
440
+ formatter . writeLine ( `// Original file: ${ ( enumType . filename ?? 'null' ) ?. replace ( / \\ / g, '/' ) } ` ) ;
441
441
formatter . writeLine ( '' ) ;
442
442
if ( options . includeComments ) {
443
443
formatComment ( formatter , enumType . comment ) ;
@@ -590,7 +590,7 @@ function generateServiceDefinitionInterface(formatter: TextFormatter, serviceTyp
590
590
}
591
591
592
592
function generateServiceInterfaces ( formatter : TextFormatter , serviceType : Protobuf . Service , options : GeneratorOptions ) {
593
- formatter . writeLine ( `// Original file: ${ serviceType . filename ?. replace ( / \\ / g, '/' ) } ` ) ;
593
+ formatter . writeLine ( `// Original file: ${ ( serviceType . filename ?? 'null' ) ?. replace ( / \\ / g, '/' ) } ` ) ;
594
594
formatter . writeLine ( '' ) ;
595
595
const grpcImportPath = options . grpcLib . startsWith ( '.' ) ? getPathToRoot ( serviceType ) + options . grpcLib : options . grpcLib ;
596
596
formatter . writeLine ( `import type * as grpc from '${ grpcImportPath } '` ) ;
0 commit comments