fix: Prevent error when maxTrashcanContents is 0 (#5739)

* fix: Prevent error when maxTrashcanContents is 0

Resolves #5729.

* Eliminate ’smart’ quotes.
This commit is contained in:
Neil Fraser
2021-11-30 10:25:16 -08:00
committed by GitHub
parent 2ca6740758
commit 341dba5965
3 changed files with 4 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ IPositionable.prototype.position;
/**
* Returns the bounding rectangle of the UI element in pixel units relative to
* the Blockly injection div.
* @return {?Rect} The UI elementss bounding box. Null if
* @return {?Rect} The UI elements's bounding box. Null if
* bounding box should be ignored by other UI elements.
*/
IPositionable.prototype.getBoundingRectangle;

View File

@@ -387,7 +387,7 @@ Trashcan.prototype.hasContents_ = function() {
* @return {boolean} True if the trashcan contents-flyout is currently open.
*/
Trashcan.prototype.contentsIsOpen = function() {
return this.flyout.isVisible();
return !!this.flyout && this.flyout.isVisible();
};
/**
@@ -480,7 +480,7 @@ Trashcan.prototype.position = function(metrics, savedPositions) {
/**
* Returns the bounding rectangle of the UI element in pixel units relative to
* the Blockly injection div.
* @return {?Rect} The UI elementss bounding box. Null if
* @return {?Rect} The UI elements's bounding box. Null if
* bounding box should be ignored by other UI elements.
*/
Trashcan.prototype.getBoundingRectangle = function() {

View File

@@ -234,7 +234,7 @@ ZoomControls.prototype.dispose = function() {
/**
* Returns the bounding rectangle of the UI element in pixel units relative to
* the Blockly injection div.
* @return {?Rect} The UI elementss bounding box. Null if
* @return {?Rect} The UI elements's bounding box. Null if
* bounding box should be ignored by other UI elements.
*/
ZoomControls.prototype.getBoundingRectangle = function() {