Skip to content

Commit

Permalink
AMQP-846: Fix NPE (adviceChain)
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell authored and artembilan committed Nov 30, 2018
1 parent 73cd8ea commit 1195658
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.lang.Nullable;
import org.springframework.retry.RecoveryCallback;
import org.springframework.retry.support.RetryTemplate;
import org.springframework.transaction.PlatformTransactionManager;
Expand Down Expand Up @@ -194,8 +195,9 @@ public void setDefaultRequeueRejected(Boolean requeueRejected) {
* @return the advice chain that was set. Defaults to {@code null}.
* @since 1.7.4
*/
@Nullable
public Advice[] getAdviceChain() {
return Arrays.copyOf(this.adviceChain, this.adviceChain.length);
return this.adviceChain == null ? null : Arrays.copyOf(this.adviceChain, this.adviceChain.length);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,9 @@ public void setAdviceChain(Advice... adviceChain) {
this.adviceChain = Arrays.copyOf(adviceChain, adviceChain.length);
}

@Nullable
protected Advice[] getAdviceChain() {
return this.adviceChain;
return this.adviceChain == null ? null : Arrays.copyOf(this.adviceChain, this.adviceChain.length);
}

/**
Expand Down

0 comments on commit 1195658

Please sign in to comment.