diff --git a/src/java/com/samskivert/util/Lifecycle.java b/src/java/com/samskivert/util/Lifecycle.java index c80f68e0..e4f1b7d4 100644 --- a/src/java/com/samskivert/util/Lifecycle.java +++ b/src/java/com/samskivert/util/Lifecycle.java @@ -60,13 +60,16 @@ public class Lifecycle */ public void addComponent (BaseComponent comp) { - if (_initers == null || _downers == null) { - throw new IllegalStateException("Too late to register component."); - } if (comp instanceof InitComponent) { + if (_initers == null) { + throw new IllegalStateException("Too late to register InitComponent."); + } _initers.add((InitComponent)comp); } if (comp instanceof ShutdownComponent) { + if (_downers == null) { + throw new IllegalStateException("Too late to register ShutdownComponent."); + } _downers.add((ShutdownComponent)comp); } }