0 evaluates to false in a logical context, allow a zero to be returned for totalRows

avoid 0 being treated as false in the || statement.