[RESOLVIDO]Nullpointerexception em método append de form

ola à todos, realmente não sei, não consigo entender por que está dando esta exceção de ponteiro nulo, ja debuguei, conferi passo a passo, o item a ser adicionado no formulário não está vazio, ele contém sim um valor, mas fica dando essa exceção, alguém pode me ajudar por favor? Obrigado à todos e desculpas adiantadas por alguma coisa, no aguarde…

A variável id é inteira, no início é setada com 0, a cada pedido realizado é incrementada em 1

Este é o método que está dando erro:

[code]public void lstRestauSystemAction() {
// enter pre-action user code here
String __selectedString = getLstRestauSystem().getString(getLstRestauSystem().getSelectedIndex());
if (__selectedString != null) {
if (__selectedString.equals(“Bebida”)) {
// write pre-action user code here
switchDisplayable(null, getFrmBebida());
// write post-action user code here
} else if (__selectedString.equals(“Comida”)) {
// write pre-action user code here
switchDisplayable(null, getFrmComida());
// write post-action user code here
} else if (__selectedString.equals(“Efetuar Pedido”)) {
// write pre-action user code here

            StringItem[] strIProduto = new StringItem[id];
            StringItem[] strIQuantidade = new StringItem[id];
            StringItem[] strIPrecoUnit = new StringItem[id];
            StringItem[] strIPrecoTotal = new StringItem[id];
            StringItem[] strIObservacoes = new StringItem[id];
            Spacer[] spcPedido = new Spacer[id];

            for (int i = 0; i < id; i++) {

                strIProduto[i] = new StringItem("Produto", vNomeProd.elementAt(i).toString());
                strIQuantidade[i] = new StringItem("Quantidade", vQtdeProd.elementAt(i).toString());
                strIPrecoUnit[i] = new StringItem("Preço Unitário",
                        vPUnitProd.elementAt(i).toString());
                strIPrecoTotal[i] = new StringItem("Preço Total",
                        vPTotalProd.elementAt(i).toString());
                strIObservacoes[i] = new StringItem("Observações", vObsProd.elementAt(i).toString());
            }

            for (int i = 0; i < id; i++) {
                frmEfetuarPedido.append(strIProduto[i]); // O erro se dá aqui
                frmEfetuarPedido.append(strIQuantidade[i]);
                frmEfetuarPedido.append(strIPrecoUnit[i]);
                frmEfetuarPedido.append(strIPrecoTotal[i]);
                frmEfetuarPedido.append(strIObservacoes[i]);

                if (i != (id - 1)) {
                    spcPedido[i] = new Spacer(frmEfetuarPedido.getWidth(), 1);
                    frmEfetuarPedido.append(spcPedido[i]);
                }
            }
            switchDisplayable(null, getFrmEfetuarPedido());
            // write post-action user code here
        }
    }
    // enter post-action user code here
}[/code]

E recebo isto no meu console:

TRACE: <at java.lang.NullPointerException: 0>, Exception caught in Display class java.lang.NullPointerException: 0 at hello.HelloMIDlet.lstRestauSystemAction(HelloMIDlet.java:322) at hello.HelloMIDlet.commandAction(HelloMIDlet.java:224) at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46 at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74 at com.sun.midp.chameleon.layers.SoftButtonLayer.soft2(), bci=173 at com.sun.midp.chameleon.layers.SoftButtonLayer.softPress(), bci=36 at com.sun.midp.chameleon.layers.SoftButtonLayer.pointerInput(), bci=142 at com.sun.midp.chameleon.CWindow.pointerInput(), bci=76 at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handlePointerEvent(), bci=19 at com.sun.midp.lcdui.DisplayEventListener.process(), bci=296 at com.sun.midp.events.EventQueue.run(), bci=179 at java.lang.Thread.run(Thread.java:662)

frmEfetuarPedido está instanciado?

sim, ai vai o código referente a ele:

[code]
private Form frmEfetuarPedido;

public Form getFrmEfetuarPedido() {
if (frmEfetuarPedido == null) {
// write pre-init user code here
frmEfetuarPedido = new Form(“form2”);
frmEfetuarPedido.addCommand(getCmdConcluirPedido());
frmEfetuarPedido.addCommand(getCmdContinuarPedido());
frmEfetuarPedido.setCommandListener(this);
// write post-init user code here
}
return frmEfetuarPedido;
}[/code]

pelo código, você está instanciando ele depois dessa linha.

Nessa:
switchDisplayable(null, getFrmEfetuarPedido());

Verifica se o frmEfetuarPedido é null, dá uma verificada também no strIProduto, mas não acho que seja ele.

:oops:

[quote]pelo código, você está instanciando ele depois dessa linha.

Nessa:
switchDisplayable(null, getFrmEfetuarPedido());

Verifica se o frmEfetuarPedido é null, dá uma verificada também no strIProduto, mas não acho que seja ele.[/quote]

era isso msm, mudei e funcionou, brigadão msm evefuji, desculpa o incomodo galera.