diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/batching/ERXBatchingDisplayGroup.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/batching/ERXBatchingDisplayGroup.java index c003d26bc61..a110cfb03d1 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/batching/ERXBatchingDisplayGroup.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/batching/ERXBatchingDisplayGroup.java @@ -345,8 +345,10 @@ public int rowCount() { if (rowCount == -1) { if (isBatching()) { rowCount = ERXEOAccessUtilities.rowCountForFetchSpecification(dataSource().editingContext(), fetchSpecification()); - } else { + } else if (dataSource() != null) { rowCount = dataSource().fetchObjects().count(); + } else if (allObjects() != null) { + rowCount = allObjects().count(); } if (shouldRememberRowCount()) { _rowCount = rowCount;