[C#]For-loop in For-loop crashes Unity.

static public void addItemToINV(BASEITEM item){
BASEITEM tempitem = ItemRecognizer(item);
bool isAlready = false;

		for(int i = 0;i < itemsSLOT.Length;i++){

			isAlready=false;
			if(itemsSLOT *!= null){*

if (itemsSLOT*._ID == tempitem.ID){
_
isAlready=true;*

* }*
* }*
* if(isAlready == true){*
itemsSLOT*._QUANTITY += tempitem._QUANTITY;*

* break;*
* }*

* else if(isAlready == false){*

* if(i == itemsSLOT.Length - 1){*

* for(int j = 0;j < itemsSLOT.Length;i++){*

* if(itemsSLOT[j] == null){*

* itemsSLOT[j] = tempitem;//*

* break;*
* }*
* }*
* break;*
* }*
* }*
* }*
* }*
When i run this method first time, it does at is it supposed to, without any problems.
However, the second time, it makes my Unity3D client crash.
I could not find another way of making this, that would not cause “item” to be added to the array, without checking through the whole array(itemsSlot) first. if anybody knows a way to do this w/o 2 For-loops, it would be greatly appreciated. or, know how to fix this.
Best regards.

for(int j = 0;j < itemsSLOT.Length;i++){
should that be j++?