Skip to content

Commit

Permalink
fix: Prevent error when maxTrashcanContents is 0 (google#5739)
Browse files Browse the repository at this point in the history
* fix: Prevent error when maxTrashcanContents is 0

Resolves google#5729.

* Eliminate ’smart’ quotes.
  • Loading branch information
NeilFraser authored Nov 30, 2021
1 parent 2ca6740 commit 341dba5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/interfaces/i_positionable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions core/trashcan.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};

/**
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion core/zoom_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 341dba5

Please sign in to comment.