Why am I getting nullpointerexception from this code?
I keep getting null pointer exception from the line:

    String[] itemTokens = rawInventory[i].split("\\s");

any ideas why?
   

     public void superMarketEngine(String filename) {
                    // Read in the inventory file
                    inventoryLoader = new LoadInventory();
                    LoadInventory row = new LoadInventory();
                    String[] rawInventory = inventoryLoader.getItemList();
                    
                
                // Create the inventory based on the number of items
                inventory = new Item[row.findRowNumber()];
                
                // Create an 'Item' object for each item, subsequently adding it to our
                // inventory array
                for (int i = 0; i <= row.findRowNumber(); i++) {
                    String[] itemTokens = rawInventory[i].split("\\s");
                    inventory[i] = new Item(itemTokens[0], Integer.parseInt(itemTokens[1]));
                }
                
                System.out.println(inventory);
                
                
               
                
            }
Why am I getting nullpointerexception from this code?
===

I keep getting null pointer exception from the line:

    String[] itemTokens = rawInventory[i].split("\\s");

any ideas why?
   

     public void superMarketEngine(String filename) {
                    // Read in the inventory file
                    inventoryLoader = new LoadInventory();
                    LoadInventory row = new LoadInventory();
                    String[] rawInventory = inventoryLoader.getItemList();
                    
                
                // Create the inventory based on the number of items
                inventory = new Item[row.findRowNumber()];
                
                // Create an 'Item' object for each item, subsequently adding it to our
                // inventory array
                for (int i = 0; i <= row.findRowNumber(); i++) {
                    String[] itemTokens = rawInventory[i].split("\\s");
                    inventory[i] = new Item(itemTokens[0], Integer.parseInt(itemTokens[1]));
                }
                
                System.out.println(inventory);
                
                
               
                
            }