Skip to content

Commit

Permalink
Fix NullPointerException when there isn't an adapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brais Gabin committed Feb 20, 2013
1 parent 88f59cb commit 744a9ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/src/com/inqbarna/tablefixheaders/TableFixHeaders.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,13 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
final int heightSize = MeasureSpec.getSize(heightMeasureSpec);

this.rowCount = adapter.getRowCount();
this.columnCount = adapter.getColumnCount();

final int w;
final int h;

if (adapter != null) {
this.rowCount = adapter.getRowCount();
this.columnCount = adapter.getColumnCount();

widths = new int[columnCount + 1];
for (int i = -1; i < columnCount; i++) {
widths[i + 1] += adapter.getWidth(i);
Expand Down

0 comments on commit 744a9ed

Please sign in to comment.