Skip to content

Commit

Permalink
Fixes NPE and makes Brave really optional
Browse files Browse the repository at this point in the history
Brave configuration needed to be looked up by name, not type.

Fixes #68
  • Loading branch information
Adrian Cole committed Mar 18, 2016
1 parent 2c4a707 commit ee79a76
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ SpanStore spanStore() {
}

@Configuration
@ConditionalOnClass(Brave.class)
protected static class BraveSpanStoreEnhancer implements BeanPostProcessor {
@ConditionalOnClass(name = "com.github.kristofa.brave.Brave")
static class BraveSpanStoreEnhancer implements BeanPostProcessor {

@Autowired(required = false)
Brave brave;
Expand Down Expand Up @@ -161,7 +161,8 @@ static class KafkaConfiguration {
class KafkaEnabledCondition extends SpringBootCondition {
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata a) {
return context.getEnvironment().getProperty("kafka.zookeeper").isEmpty() ?
String kafkaZookeeper = context.getEnvironment().getProperty("kafka.zookeeper");
return kafkaZookeeper == null || kafkaZookeeper.isEmpty() ?
ConditionOutcome.noMatch("kafka.zookeeper isn't set") :
ConditionOutcome.match();
}
Expand Down

0 comments on commit ee79a76

Please sign in to comment.