summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-01-16 16:56:27 +0000
committerKHobbits <rob@khobbits.co.uk>2013-01-16 16:56:27 +0000
commit35036ecc186cff2366a00571ac599095c3701b67 (patch)
treeac5a99e2cb625c74745c12934a3e1894c85e7945
parentb3cc4dbe096638e6e57e9ce8e4f0d9703019eebb (diff)
downloadEssentials-35036ecc186cff2366a00571ac599095c3701b67.tar
Essentials-35036ecc186cff2366a00571ac599095c3701b67.tar.gz
Essentials-35036ecc186cff2366a00571ac599095c3701b67.tar.lz
Essentials-35036ecc186cff2366a00571ac599095c3701b67.tar.xz
Essentials-35036ecc186cff2366a00571ac599095c3701b67.zip
Fix null args on /book
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbook.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbook.java b/Essentials/src/com/earth2me/essentials/commands/Commandbook.java
index 90c5c4f35..1a28a5f86 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbook.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbook.java
@@ -25,26 +25,26 @@ public class Commandbook extends EssentialsCommand
{
BookMeta bmeta = (BookMeta)item.getItemMeta();
- if (args[0].equalsIgnoreCase("author"))
+ if (args.length > 1 && args[0].equalsIgnoreCase("author"))
{
if (user.isAuthorized("essentals.book.author"))
{
bmeta.setAuthor(args[1]);
item.setItemMeta(bmeta);
- user.sendMessage(_("bookAuthorSet", args[1]));
+ user.sendMessage(_("bookAuthorSet", getFinalArg(args, 1)));
}
else
{
throw new Exception(_("denyChangeAuthor"));
}
}
- else if (args[0].equalsIgnoreCase("title"))
+ else if (args.length > 1 && args[0].equalsIgnoreCase("title"))
{
if (user.isAuthorized("essentials.book.title") && (isAuthor(bmeta, player) || user.isAuthorized("essentials.book.others")))
{
bmeta.setTitle(args[1]);
item.setItemMeta(bmeta);
- user.sendMessage(_("bookTitleSet", args[1]));
+ user.sendMessage(_("bookTitleSet", getFinalArg(args, 1)));
}
else
{