My custom listview adapter throws a null pointer exception I can't figure out why
<p>The null pointer is thrown after 1 cycle of getView. ie the first element on the list is returned fine but it crashes on the second one.</p>

<p>it says holder is null. refering to the <code>holder.textName.setText(station)</code> bit.</p>

<p>Any idea why?</p>

<pre><code>...
static class StationHolder {
        TextView textName;
        ImageView imgStationImage;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View row = convertView;
        StationHolder holder = null;

        Typeface tfBoldCon = Typeface.createFromAsset(context.getAssets(),
                "Roboto-BoldCondensed.ttf");
        Typeface tfCon = Typeface.createFromAsset(context.getAssets(),
                "Roboto-Condensed.ttf");
        Typeface tfLight = Typeface.createFromAsset(context.getAssets(),
                "Roboto-Light.ttf");

        if (row == null) {
            LayoutInflater inflater = ((Activity) context).getLayoutInflater();
            row = inflater.inflate(viewResourceId, parent, false);

            holder = new StationHolder();
            holder.textName = (TextView) row.findViewById(R.id.station_name);
            holder.textName.setTypeface(tfCon);
            holder.imgStationImage = (ImageView) row
                    .findViewById(R.id.station_image);

        } else {
            holder = (StationHolder) row.getTag();
        }

        final String station = stations.get(position);
        Log.i("", station);

        if (station != null) {
            holder.textName.setText(station);
        }
        return row;
    }
</code></pre>
