diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index d9947b5b0..2d8fc38f3 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -936,9 +936,15 @@ const FolderView = new Lang.Class({ layout.hookup_style(icon); let subSize = Math.floor(FOLDER_SUBICON_FRACTION * size); - for (let i = 0; i < Math.min(this._allItems.length, 4); i++) { - let texture = this._allItems[i].app.create_icon_texture(subSize); - let bin = new St.Bin({ child: texture }); + let numItems = this._allItems.length; + for (let i = 0; i < 4; i++) { + let bin; + if (i < numItems) { + let texture = this._allItems[i].app.create_icon_texture(subSize); + bin = new St.Bin({ child: texture }); + } else { + bin = new St.Bin({ width: subSize, height: subSize }); + } layout.pack(bin, i % 2, Math.floor(i / 2)); }