I would guess you're calling getItemID() on an uninitialized (NULL) member of the productSpecifications array. I don't know the extent of your program, but a HashMap object might be better suited for your list of ProductSpecifications rather an an array, ArrayList, or whatever you're using to index it.
Also, as a tip, you can use the "break;" command in that for loop so you don't have to use a boolean flag. It simply breaks out of the inner most loop.
|