mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Clean up optRuntime checks in blocklyListen
This commit is contained in:
parent
2171cb69d0
commit
d58bb8bcfb
1 changed files with 5 additions and 5 deletions
|
@ -358,14 +358,14 @@ class Blocks {
|
||||||
stage.deleteVariable(e.varId);
|
stage.deleteVariable(e.varId);
|
||||||
break;
|
break;
|
||||||
case 'comment_create':
|
case 'comment_create':
|
||||||
if (optRuntime.getEditingTarget()) {
|
if (optRuntime && optRuntime.getEditingTarget()) {
|
||||||
const currTarget = optRuntime.getEditingTarget();
|
const currTarget = optRuntime.getEditingTarget();
|
||||||
currTarget.createComment(e.commentId, e.blockId, e.text,
|
currTarget.createComment(e.commentId, e.blockId, e.text,
|
||||||
e.xy.x, e.xy.y, e.width, e.height, e.minimized);
|
e.xy.x, e.xy.y, e.width, e.height, e.minimized);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'comment_change':
|
case 'comment_change':
|
||||||
if (optRuntime) {
|
if (optRuntime && optRuntime.getEditingTarget()) {
|
||||||
const currTarget = optRuntime.getEditingTarget();
|
const currTarget = optRuntime.getEditingTarget();
|
||||||
if (!currTarget.comments.hasOwnProperty(e.commentId)) {
|
if (!currTarget.comments.hasOwnProperty(e.commentId)) {
|
||||||
log.warn(`Cannot change comment with id ${e.commentId} because it does not exist.`);
|
log.warn(`Cannot change comment with id ${e.commentId} because it does not exist.`);
|
||||||
|
@ -392,9 +392,9 @@ class Blocks {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'comment_move':
|
case 'comment_move':
|
||||||
if (optRuntime) {
|
if (optRuntime && optRuntime.getEditingTarget()) {
|
||||||
const currTarget = optRuntime.getEditingTarget();
|
const currTarget = optRuntime.getEditingTarget();
|
||||||
if (!currTarget.comments.hasOwnProperty(e.commentId)) {
|
if (currTarget && !currTarget.comments.hasOwnProperty(e.commentId)) {
|
||||||
log.warn(`Cannot change comment with id ${e.commentId} because it does not exist.`);
|
log.warn(`Cannot change comment with id ${e.commentId} because it does not exist.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -405,7 +405,7 @@ class Blocks {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'comment_delete':
|
case 'comment_delete':
|
||||||
if (optRuntime) {
|
if (optRuntime && optRuntime.getEditingTarget()) {
|
||||||
const currTarget = optRuntime.getEditingTarget();
|
const currTarget = optRuntime.getEditingTarget();
|
||||||
if (!currTarget.comments.hasOwnProperty(e.commentId)) {
|
if (!currTarget.comments.hasOwnProperty(e.commentId)) {
|
||||||
// If we're in this state, we have probably received
|
// If we're in this state, we have probably received
|
||||||
|
|
Loading…
Reference in a new issue