Skip to content

Commit

Permalink
Remove possible NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Clarke, Peter authored and Clarke, Peter committed Jan 31, 2017
1 parent fb428cb commit 519e7c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hystrix-core/src/main/java/com/netflix/hystrix/Hystrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@ public int size() {
}

public E peek() {
if (top.get() == null) {
Node<E> eNode = top.get();
if (eNode == null) {
return null;
} else {
return top.get().item;
return eNode.item;
}
}

Expand Down

0 comments on commit 519e7c8

Please sign in to comment.