Thread: [vassalengine-svn] SF.net SVN: vassalengine:[8782] VSQL-src/trunk/tdc/AttackWizard.java
Brought to you by:
rodneykinney,
uckelman
From: <swa...@us...> - 2013-06-30 22:53:57
|
Revision: 8782 http://sourceforge.net/p/vassalengine/svn/8782 Author: swampwallaby Date: 2013-06-30 22:53:55 +0000 (Sun, 30 Jun 2013) Log Message: ----------- Bug 10208 - bad custom code in The Devil's Cauldron module - NPE in tdc.AttackWizard$WizardCloseCommand.myUndoCommand Bug 10272 - Bad Custom Code in Devils Cauldron - NPE at at tdc.AttackWizard.getRangeToTarget Modified Paths: -------------- VSQL-src/trunk/tdc/AttackWizard.java Modified: VSQL-src/trunk/tdc/AttackWizard.java =================================================================== --- VSQL-src/trunk/tdc/AttackWizard.java 2013-06-24 22:01:43 UTC (rev 8781) +++ VSQL-src/trunk/tdc/AttackWizard.java 2013-06-30 22:53:55 UTC (rev 8782) @@ -145,7 +145,7 @@ } public int getRangeToTarget() { - return myModel.getRange(); + return myModel == null ? 1 : myModel.getRange(); } // Target has been changed by another client @@ -690,7 +690,12 @@ } protected Command myUndoCommand() { - return new WizardOpenCommand(wizard, wizard.getSource().getId(), wizard.getTargetPoint(), wizard.getRangeToTarget()); + if (wizard == null) { + return null; + } + final GamePiece source = wizard.getSource(); + final String id = (source == null) ? "" : source.getId(); + return wizard == null ? null : new WizardOpenCommand(wizard, id, wizard.getTargetPoint(), wizard.getRangeToTarget()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |