Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use instance check

Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
  • Loading branch information...
commit 607c0db584035ea55ad85c580aa17a9aabb420c2 1 parent 23f7493
@guw guw authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 hello.service/src/hello/service/GreetingServiceComponent.java
View
10 hello.service/src/hello/service/GreetingServiceComponent.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2012 AGETO Service GmbH and others.
* All rights reserved.
- *
- * This program and the accompanying materials are made available under the
+ *
+ * This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v1.0 which accompanies this distribution,
* and is available at https://www.eclipse.org/org/documents/edl-v10.html.
*
@@ -81,7 +81,11 @@ public void deactivate(final ComponentContext context) {
}
public GreetingService getService() {
- return service;
+ final GreetingService greetingService = service;
+ if (greetingService == null) {
+ throw new IllegalStateException("inactive");
+ }
+ return greetingService;
}
@Override
Please sign in to comment.
Something went wrong with that request. Please try again.