mirror of https://github.com/apache/cassandra
fix npe if configURL is null (new URL(null) throws)
This commit is contained in:
parent
3047ab6387
commit
3fb2dcdf06
|
|
@ -38,9 +38,12 @@ public class SnitchProperties
|
|||
String configURL = System.getProperty(RACKDC_PROPERTY_FILENAME);
|
||||
try
|
||||
{
|
||||
URL url = new URL(configURL);
|
||||
URL url;
|
||||
if (configURL == null)
|
||||
url = SnitchProperties.class.getClassLoader().getResource(RACKDC_PROPERTY_FILENAME);
|
||||
else
|
||||
url = new URL(configURL);
|
||||
|
||||
stream = url.openStream(); // catch block handles potential NPE
|
||||
properties.load(stream);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue