Permalink
Browse files

Fix it

  • Loading branch information...
1 parent d7df6be commit 28c945c940aefb8570fcd0a1e410b4a0e6029d41 @MasseR committed May 3, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/itemstats_srv.erl
View
@@ -88,7 +88,10 @@ init([]) ->
handle_call({get, Key}, _From, State) ->
{reply, internal_aggregate_value(Key), State};
handle_call({owners, ItemId}, _From, State) ->
- Turtles = dets:lookup(?MODULE, ItemId),
+ Turtles = case dets:lookup(?MODULE, ItemId) of
+ [{_, T}] -> sets:to_list(T);
+ [] -> []
+ end,
TurtlesWithCount = [{TurtleId, internal_value(ItemId, TurtleId)} || TurtleId <- Turtles],
{reply, TurtlesWithCount, State};
handle_call({get, Key, TurtleId}, _From, State) ->

0 comments on commit 28c945c

Please sign in to comment.