Skip to content

Commit

Permalink
Merge pull request #1469 from petercla/master
Browse files Browse the repository at this point in the history
Remove possible NPE
  • Loading branch information
mattrjacobs authored Feb 7, 2017
2 parents c17d487 + 519e7c8 commit 7fdda15
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 7fdda15

Please sign in to comment.