Skip to content

Commit 9819e41

Browse files
Mike Wiederholdingenthr
authored andcommitted
Fixed issue regarding connecting to a non-existent bucket
Connecting to a Membase server correctly, but specifying a bucket that doesn't exist causes the BufferedReader in the readToString function to be null. This causes a NPE when we attempt to close the reader. Change-Id: I7f82596156c697b57b061bf066686aded16b772a Reviewed-on: http://review.couchbase.org/7575 Tested-by: Matt Ingenthron <[email protected]> Reviewed-by: Matt Ingenthron <[email protected]>
1 parent 24e0091 commit 9819e41

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/net/spy/memcached/vbucket/ConfigurationProviderHTTP.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ private String readToString(URLConnection connection) throws IOException {
266266
}
267267
return buffer.toString();
268268
} finally {
269-
reader.close();
269+
if (reader != null) {
270+
reader.close();
271+
}
270272
}
271273
}
272274

0 commit comments

Comments
 (0)