mirror of
https://github.com/google/blockly.git
synced 2026-01-05 08:00:09 +01:00
fix: Made workspace non-nullable. (#6300)
* Made workspace non-nullable. * chore: clang-format files. * fix: Fixed incorrect block disposal check in connection.ts
This commit is contained in:
@@ -264,7 +264,7 @@ export abstract class Field implements IASTNodeLocationSvg,
|
||||
* @return The renderer constant provider.
|
||||
*/
|
||||
getConstants(): ConstantProvider|null {
|
||||
if (!this.constants_ && this.sourceBlock_ && this.sourceBlock_.workspace &&
|
||||
if (!this.constants_ && this.sourceBlock_ && !this.sourceBlock_.disposed &&
|
||||
this.sourceBlock_.workspace.rendered) {
|
||||
this.constants_ = (this.sourceBlock_.workspace as WorkspaceSvg)
|
||||
.getRenderer()
|
||||
@@ -1023,7 +1023,7 @@ export abstract class Field implements IASTNodeLocationSvg,
|
||||
* @param e Mouse down event.
|
||||
*/
|
||||
protected onMouseDown_(e: Event) {
|
||||
if (!this.sourceBlock_ || !this.sourceBlock_.workspace) {
|
||||
if (!this.sourceBlock_ || this.sourceBlock_.disposed) {
|
||||
return;
|
||||
}
|
||||
const gesture = (this.sourceBlock_.workspace as WorkspaceSvg).getGesture(e);
|
||||
|
||||
Reference in New Issue
Block a user