Prevent NPE for the case of 0 rows.