Adding a check for NPE in EmptyrowsCursor