|
From: <th...@us...> - 2008-12-31 20:06:21
|
Revision: 8762
http://pcgen.svn.sourceforge.net/pcgen/?rev=8762&view=rev
Author: thpr
Date: 2008-12-31 20:06:16 +0000 (Wed, 31 Dec 2008)
Log Message:
-----------
additional token fixes
Modified Paths:
--------------
Trunk/pcgen/code/src/java/plugin/lsttokens/AbilityLst.java
Trunk/pcgen/code/src/java/plugin/lsttokens/CompanionListLst.java
Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/AbilityLst.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/lsttokens/AbilityLst.java 2008-12-31 19:43:52 UTC (rev 8761)
+++ Trunk/pcgen/code/src/java/plugin/lsttokens/AbilityLst.java 2008-12-31 20:06:16 UTC (rev 8762)
@@ -200,6 +200,10 @@
CDOMReference<Ability> ref =
TokenUtilities.getTypeOrPrimitive(context,
ABILITY_CLASS, category, clearText);
+ if (ref == null)
+ {
+ return false;
+ }
context.getListContext().removeFromList(getTokenName(), obj,
abilList, ref);
}
Modified: Trunk/pcgen/code/src/java/plugin/lsttokens/CompanionListLst.java
===================================================================
--- Trunk/pcgen/code/src/java/plugin/lsttokens/CompanionListLst.java 2008-12-31 19:43:52 UTC (rev 8761)
+++ Trunk/pcgen/code/src/java/plugin/lsttokens/CompanionListLst.java 2008-12-31 20:06:16 UTC (rev 8762)
@@ -161,10 +161,17 @@
}
else if (tokString.startsWith("RACETYPE="))
{
+ String raceType = tokString.substring(9);
+ if (raceType.length() == 0)
+ {
+ Logging.log(Logging.LST_ERROR, getTokenName()
+ + " Error: RaceType was not specified.");
+ return false;
+ }
races.add(new ObjectMatchingReference<Race, RaceType>(tokString,
Race.class,
context.ref.getCDOMAllReference(Race.class),
- ObjectKey.RACETYPE, RaceType.getConstant(value)));
+ ObjectKey.RACETYPE, RaceType.getConstant(raceType)));
}
else
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|