Check if widget cursor is null

pull/795/head
Alex Baker 6 years ago
parent 49ad035ab0
commit ebd7c1f9d8

@ -100,7 +100,7 @@ class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory {
@Override @Override
public int getCount() { public int getCount() {
return cursor.getCount(); return cursor == null ? 0 : cursor.getCount();
} }
@Override @Override
@ -208,7 +208,7 @@ class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory {
} }
private Task getTask(int position) { private Task getTask(int position) {
return cursor.moveToPosition(position) ? new Task(cursor) : null; return cursor != null && cursor.moveToPosition(position) ? new Task(cursor) : null;
} }
private String getQuery(Filter filter) { private String getQuery(Filter filter) {

Loading…
Cancel
Save