Skip to content

Commit 50d2508

Browse files
committed
Fixed typescript problems.
1 parent 6bcace6 commit 50d2508

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) {
@@ -264,10 +267,10 @@ const CLASS_METHOD_DEF = {
264267
return legalName;
265268
},
266269
getMethod: function (this: ClassMethodDefBlock): commonStorage.Method | null {
267-
const method = {
270+
const method: commonStorage.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',

0 commit comments

Comments
 (0)