Update src/db_adapters/boss_db_adapter_riak.erl #49

Merged
merged 1 commit into from Jan 15, 2013
Jump to file or symbol
Failed to load files and symbols.
+5 −1
Split
@@ -76,7 +76,11 @@ find(Conn, Type, Conditions, Max, Skip, Sort, SortOrder) ->
end,
case Max of
all -> lists:nthtail(Skip, Sorted);
- _ -> lists:sublist(Sorted, Skip + 1, Max)
+ Max when Skip < length(Sorted) ->
+ lists:sublist(Sorted, Skip + 1, Max);
+ _ ->
+ []
+
end.
% this is a stub just to make the tests runable