NullPointerException infix to postfix
<p>I've already asked a question related to this program, but now I have a different issue.  I'm getting NullPointerException, and I'm not entirely sure why.</p>

<blockquote>
<pre><code>Exception in thread "main" java.lang.NullPointerException
    at Convertidor2.prioridad(Convertidor2.java:73)
    at Convertidor2.convierte(Convertidor2.java:30)
    at Convertidor2.main(Convertidor2.java:85)
Java Result: 1
</code></pre>
</blockquote>

<pre><code>public class Convertidor2 {

    public static String convierte(String x) {
        String output = "";
        ArrayStack&lt;Character&gt; pila = new ArrayStack();
        for (int i = 0; i &lt; x.length(); i++) {
            char c = x.charAt(i);
            if (c == ('+') || c == ('*') || c == ('-') || c == ('/')) {
                //This while throws a NullPointerException.
                while (!pila.isEmpty() &amp;&amp; prioridad(pila.peek()) &gt;= prioridad(c))
                    output += pila.pop();
                pila.push(c);
            } else if (c == '(') {
                pila.push(c);
            } else if (c == ')') {
                while (!pila.peek().equals('('))
                    output += pila.pop();
                pila.pop();
            } else
                output += c;
        }

        while (!pila.isEmpty())
            output += pila.pop();
        return output;
    }

    public static int prioridad(Object x) {
        //this line throws a NullPointerException
        if (x.equals('+') || x.equals('-'))
            return 1;
        else if (x.equals('*') || x.equals('/'))
            return 2;
        else if (x.equals('^'))
            return 3;
        else
            return 0;
    }

    public static void main(String[] args) {
        System.out.println(convierte("5+3*(10/2"));
    }
}
</code></pre>
