Check if parameter has a type before attempting to access. Should fix #26

This commit is contained in:
Kim Biesbjerg 2017-03-20 15:17:46 +01:00
parent bf3b1b29bf
commit c5d68cfcaa

View File

@ -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;
}