Browse files

Don't crash when starting the application without app_module specified

  • Loading branch information...
1 parent 8aa9821 commit 27357b35191831aa65ff940956ea32476ee84357 @yrashk committed Dec 8, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/expm.ex
View
8 lib/expm.ex
@@ -27,8 +27,12 @@ defmodule Expm do
use Application.Behaviour
def start(start_type, start_args) do
- {:ok, m} = :application.get_env(:expm, :app_module)
- m.start(start_type, start_args)
+ case :application.get_env(:expm, :app_module) do
+ {:ok, m} ->
+ m.start(start_type, start_args)
+ _ ->
+ {:ok, self}
+ end
end
def start, do: Application.start(:expm)

0 comments on commit 27357b3

Please sign in to comment.