Null pointer checks

pull/14/head
Sam Bosley 11 years ago
parent 9a24667295
commit f6aa199db6

@ -50,7 +50,11 @@ public class ConstructOutstandingTableFromMasterTable<TYPE extends RemoteModel,
oe.clear(); oe.clear();
oe.setValue(OutstandingEntry.ENTITY_ID_PROPERTY, itemId); oe.setValue(OutstandingEntry.ENTITY_ID_PROPERTY, itemId);
oe.setValue(OutstandingEntry.COLUMN_STRING_PROPERTY, p.name); oe.setValue(OutstandingEntry.COLUMN_STRING_PROPERTY, p.name);
oe.setValue(OutstandingEntry.VALUE_STRING_PROPERTY, items.get(p).toString()); Object value = items.get(p);
if (value == null)
continue;
oe.setValue(OutstandingEntry.VALUE_STRING_PROPERTY, value.toString());
oe.setValue(OutstandingEntry.CREATED_AT_PROPERTY, createdAt); oe.setValue(OutstandingEntry.CREATED_AT_PROPERTY, createdAt);
outstandingDao.createNew(oe); outstandingDao.createNew(oe);
} }

@ -474,14 +474,16 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
} }
userActivityDao.createNew(userActivity); userActivityDao.createNew(userActivity);
commentField.setText(""); //$NON-NLS-1$ if (commentField != null)
commentField.setText(""); //$NON-NLS-1$
pendingCommentPicture = usePicture ? null : pendingCommentPicture; pendingCommentPicture = usePicture ? null : pendingCommentPicture;
if (usePicture) { if (usePicture) {
if (activity != null) if (activity != null)
activity.getIntent().removeExtra(TaskEditFragment.TOKEN_PICTURE_IN_PROGRESS); activity.getIntent().removeExtra(TaskEditFragment.TOKEN_PICTURE_IN_PROGRESS);
} }
pictureButton.setImageResource(cameraButton); if (pictureButton != null)
pictureButton.setImageResource(cameraButton);
StatisticsService.reportEvent(StatisticsConstants.ACTFM_TASK_COMMENT); StatisticsService.reportEvent(StatisticsConstants.ACTFM_TASK_COMMENT);
setUpListAdapter(); setUpListAdapter();

@ -886,6 +886,8 @@ public class TaskListFragment extends SherlockListFragment implements OnScrollLi
* this occurs to save resources and time. * this occurs to save resources and time.
*/ */
public void onScrollStateChanged(AbsListView view, int scrollState) { public void onScrollStateChanged(AbsListView view, int scrollState) {
if (taskAdapter == null)
return;
switch (scrollState) { switch (scrollState) {
case OnScrollListener.SCROLL_STATE_IDLE: case OnScrollListener.SCROLL_STATE_IDLE:
if (taskAdapter.isFling) if (taskAdapter.isFling)

Loading…
Cancel
Save