File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export class ItemContainer {
55
55
for ( let i = 0 ; i < this . size ; i ++ ) {
56
56
const item = this . items [ i ] ;
57
57
58
- if ( item && item . itemId === search ) {
58
+ if ( hasValueNotNull ( item ) && item . itemId === search ) {
59
59
slots . push ( i ) ;
60
60
}
61
61
}
@@ -66,7 +66,7 @@ export class ItemContainer {
66
66
67
67
public findIndex ( item : number | Item ) : number {
68
68
const itemId = ( typeof item === 'number' ) ? item : item . itemId ;
69
- return this . _items . findIndex ( i => i && i . itemId === itemId ) ;
69
+ return this . _items . findIndex ( i => hasValueNotNull ( i ) && i . itemId === itemId ) ;
70
70
}
71
71
72
72
public setAll ( items : Item [ ] , fireEvent : boolean = true ) : void {
@@ -88,7 +88,7 @@ export class ItemContainer {
88
88
89
89
public findItemIndex ( item : Item ) : number {
90
90
for ( let i = 0 ; i < this . _size ; i ++ ) {
91
- if ( this . _items [ i ] &&
91
+ if ( hasValueNotNull ( this . _items [ i ] ) &&
92
92
this . _items [ i ] . itemId === item . itemId &&
93
93
this . _items [ i ] . amount >= item . amount ) {
94
94
return i ;
You can’t perform that action at this time.
0 commit comments