diff --git a/src/com/massivecraft/mcore/mcorecmd/CmdMCoreMStoreCopydb.java b/src/com/massivecraft/mcore/mcorecmd/CmdMCoreMStoreCopydb.java index 25a6a62d..0a3ea92e 100644 --- a/src/com/massivecraft/mcore/mcorecmd/CmdMCoreMStoreCopydb.java +++ b/src/com/massivecraft/mcore/mcorecmd/CmdMCoreMStoreCopydb.java @@ -31,12 +31,22 @@ public class CmdMCoreMStoreCopydb extends MCoreCommand { // Args final String fromAlias = this.arg(0); + final Db fromDb = MStore.getDb(fromAlias); + if (fromDb == null) + { + msg("could not get the from-database."); + return; + } + final String toAlias = this.arg(1); + final Db toDb = MStore.getDb(toAlias); + if (toDb == null) + { + msg("could not get the to-database."); + return; + } // Prepare - final Db fromDb = MStore.getDb(fromAlias); - final Db toDb = MStore.getDb(toAlias); - final Driver fromDriver = fromDb.getDriver(); final Driver toDriver = toDb.getDriver(); diff --git a/src/com/massivecraft/mcore/store/MongoGsonConverter.java b/src/com/massivecraft/mcore/store/MongoGsonConverter.java index daee022e..1c0f34f9 100644 --- a/src/com/massivecraft/mcore/store/MongoGsonConverter.java +++ b/src/com/massivecraft/mcore/store/MongoGsonConverter.java @@ -70,7 +70,7 @@ public final class MongoGsonConverter if (inElement.isJsonNull()) return null; JsonPrimitive in = inElement.getAsJsonPrimitive(); if (in.isBoolean()) return in.getAsBoolean(); - if (in.isNumber()) return in.getAsNumber(); + if (in.isNumber()) return in.getAsNumber().doubleValue(); if (in.isString()) return in.getAsString(); throw new IllegalArgumentException("Unsupported value type for: " + in); }