Check if parameter has a type before attempting to access. Should fix #26
This commit is contained in:
parent
bf3b1b29bf
commit
c5d68cfcaa
@ -54,7 +54,11 @@ export class AstServiceParser implements ParserInterface {
|
||||
}
|
||||
|
||||
// Make sure className is of the correct type
|
||||
const className: string = ((parameter.type as ts.TypeReferenceNode).typeName as ts.Identifier).text;
|
||||
const parameterType: ts.Identifier = (parameter.type as ts.TypeReferenceNode).typeName as ts.Identifier;
|
||||
if (!parameterType) {
|
||||
return false;
|
||||
}
|
||||
const className: string = parameterType.text;
|
||||
if (className !== this._serviceClassName) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user