Skip to content

Commit 1ffac13

Browse files
committed
use non-null assertion
1 parent e6b6b75 commit 1ffac13

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/kotlin/ratpack/example/kotlin/HandlerFactory.kt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import ratpack.guice.BindingsSpec
1010

1111
class HandlerFactory : ratpack.launch.HandlerFactory {
1212
override fun create(launchConfig : LaunchConfig?) : Handler? {
13-
if (launchConfig is LaunchConfig) {
14-
return handler(launchConfig, registerModules, routes)
15-
} else {
16-
throw IllegalArgumentException("launchConfig cannot be null")
17-
}
13+
return handler(launchConfig!!, registerModules, routes)
1814
}
1915

2016
/**
@@ -23,11 +19,11 @@ class HandlerFactory : ratpack.launch.HandlerFactory {
2319
* This is only invoked once during application bootstrap. If you change the
2420
* module configuration of an application, you must restart it.
2521
*/
26-
private val registerModules = Action { (registry: BindingsSpec?) ->
22+
private val registerModules = Action {(registry : BindingsSpec?) ->
2723
registry!!.add(MyModule())
2824
}
2925

30-
private val routes = Action { (chain : Chain?) ->
26+
private val routes = Action {(chain : Chain?) ->
3127
Routes().execute(chain!!)
3228
}
3329

0 commit comments

Comments
 (0)