Skip to content

Commit c880c61

Browse files
authored
Merge pull request #3098 from adumesny/master
update gitignore
2 parents 20f2e50 + 4ec9dec commit c880c61

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ dist_save
88
node_modules
99
.vscode
1010
.idea/
11+
.DS_Store

src/gridstack.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,14 @@ export class GridStack {
420420
* @param w GridStackWidget definition. used MakeWidget(el) if you have dom element instead.
421421
*/
422422
public addWidget(w: GridStackWidget): GridItemHTMLElement {
423+
if (!w) return;
423424
if (typeof w === 'string') { console.error('V11: GridStack.addWidget() does not support string anymore. see #2736'); return; }
424425
if ((w as HTMLElement).ELEMENT_NODE) { console.error('V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()'); return this.makeWidget(w as HTMLElement); }
425426

426427
let el: GridItemHTMLElement;
427428
let node: GridStackNode = w;
428429
node.grid = this;
429-
if (node?.el) {
430+
if (node.el) {
430431
el = node.el; // re-use element stored in the node
431432
} else if (GridStack.addRemoveCB) {
432433
el = GridStack.addRemoveCB(this.el, w, true, false);

0 commit comments

Comments
 (0)