Skip to content

Commit

Permalink
Exception Handling for Null Pointer Exception in BrokerService (apach…
Browse files Browse the repository at this point in the history
…e#3108)

### Motivation
In a unit test under pulsar-broker, I have found that some NullPointerExceptions were thrown, although the tests had passed. I decided it will be best if we minimized the number of such exceptions as they are usually not intentionally thrown.

### Result
The NullPointerException will no longer occur.
  • Loading branch information
ConcurrencyPractitioner authored and sijie committed Dec 4, 2018
1 parent dedeb33 commit c60cf47
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public void close() throws IOException {
public void unloadNamespaceBundlesGracefully() {
try {
// make broker-node unavailable from the cluster
if (pulsar.getLoadManager() != null) {
if (pulsar.getLoadManager() != null && pulsar.getLoadManager().get() != null) {
try {
pulsar.getLoadManager().get().disableBroker();
} catch (PulsarServerException.NotFoundException ne) {
Expand Down

0 comments on commit c60cf47

Please sign in to comment.