Skip to content

Commit

Permalink
Prevent crash when call refreshView and Caldroid is not yet created
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdao committed Oct 14, 2013
1 parent b4978e9 commit 5f27b80
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/src/com/roomorama/caldroid/CaldroidFragment.java
Expand Up @@ -844,6 +844,11 @@ public boolean onItemLongClick(AdapterView<?> parent,
* parameters first, then call this method.
*/
public void refreshView() {
// If month and year is not yet initialized, refreshView doesn't do anything
if (month == -1 || year == -1) {
return;
}

// Refresh title view
monthTitleTextView
.setText(new DateTime(year, month, 1, 0, 0, 0, 0).format(
Expand Down

0 comments on commit 5f27b80

Please sign in to comment.