Skip to content

Commit 2b5d717

Browse files
committed
Fix typescript errors
1 parent 6bcace6 commit 2b5d717

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/blocks/mrc_class_method_def.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ const CLASS_METHOD_DEF = {
193193
}
194194
this.mrcUpdateParams();
195195
if (this.mrcCanBeCalledWithinClass) {
196-
mutateMethodCallers(this.workspace, this.id, this.getMethodForWithin());
196+
const methodForWithin = this.getMethodForWithin();
197+
if (methodForWithin) {
198+
mutateMethodCallers(this.workspace, this.id, methodForWithin);
199+
}
197200
}
198201
},
199202
decompose: function (this: ClassMethodDefBlock, workspace: Blockly.Workspace) {
@@ -267,15 +270,15 @@ const CLASS_METHOD_DEF = {
267270
const method = {
268271
blockId: this.id,
269272
visibleName: this.getFieldValue(FIELD_METHOD_NAME),
270-
pythonName: this.mrcFuncName,
273+
pythonName: this.mrcFuncName ? this.mrcFuncName : '',
271274
returnType: this.mrcReturnType,
272275
args: [{
273276
name: 'self',
274277
type: '',
275278
}],
276279
};
277280
if (!method.pythonName) {
278-
method.pythonName = method.visibleName;
281+
method.pythonName = method.visibleName as string;
279282
}
280283
this.mrcParameters.forEach(param => {
281284
method.args.push({

0 commit comments

Comments
 (0)