mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-17 20:11:21 +02:00
Catch class cast exceptions in EssentialsConf
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1491 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
@@ -186,7 +186,15 @@ public class EssentialsConf extends Configuration
|
|||||||
|
|
||||||
public long getLong(String path, long def)
|
public long getLong(String path, long def)
|
||||||
{
|
{
|
||||||
Number num = (Number)getProperty(path);
|
Number num;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
num = (Number)getProperty(path);
|
||||||
|
}
|
||||||
|
catch(ClassCastException ex)
|
||||||
|
{
|
||||||
|
return def;
|
||||||
|
}
|
||||||
if (num == null)
|
if (num == null)
|
||||||
{
|
{
|
||||||
return def;
|
return def;
|
||||||
@@ -197,7 +205,15 @@ public class EssentialsConf extends Configuration
|
|||||||
@Override
|
@Override
|
||||||
public double getDouble(String path, double def)
|
public double getDouble(String path, double def)
|
||||||
{
|
{
|
||||||
Number num = (Number)getProperty(path);
|
Number num;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
num = (Number)getProperty(path);
|
||||||
|
}
|
||||||
|
catch(ClassCastException ex)
|
||||||
|
{
|
||||||
|
return def;
|
||||||
|
}
|
||||||
if (num == null)
|
if (num == null)
|
||||||
{
|
{
|
||||||
return def;
|
return def;
|
||||||
|
Reference in New Issue
Block a user