Skip to content

Commit

Permalink
Fix bug introduced in commit 658a0a2, causing an undefined dispatch_l…
Browse files Browse the repository at this point in the history
…ist. Detect undefined dispatch list in code, and use empty list by default.
  • Loading branch information
rustyio committed Aug 4, 2011
1 parent 58847a1 commit d6cc4f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/webmachine_router.erl
Expand Up @@ -139,8 +139,12 @@ filter_by_resource({_, _, _}, _Resource) ->
true.

get_dispatch_list() ->
{ok, Dispatch} = application:get_env(webmachine, dispatch_list),
Dispatch.
case application:get_env(webmachine, dispatch_list) of
{ok, Dispatch} ->
Dispatch;
undefined ->
[]
end.

set_dispatch_list(DispatchList) ->
ok = application:set_env(webmachine, dispatch_list, DispatchList),
Expand Down

0 comments on commit d6cc4f5

Please sign in to comment.