From: <bee...@us...> - 2011-03-20 17:30:05
|
Revision: 8227 http://megamek.svn.sourceforge.net/megamek/?rev=8227&view=rev Author: beerockxs Date: 2011-03-20 17:29:57 +0000 (Sun, 20 Mar 2011) Log Message: ----------- Modified Paths: -------------- trunk/megamek/src/megamek/client/ui/swing/BoardView1.java Modified: trunk/megamek/src/megamek/client/ui/swing/BoardView1.java =================================================================== --- trunk/megamek/src/megamek/client/ui/swing/BoardView1.java 2011-03-20 15:09:32 UTC (rev 8226) +++ trunk/megamek/src/megamek/client/ui/swing/BoardView1.java 2011-03-20 17:29:57 UTC (rev 8227) @@ -5496,17 +5496,20 @@ if (mhex.containsTerrain(Terrains.BUILDING)) { // Get the building. Building bldg = game.getBoard().getBuildingAt(mcoords); - StringBuffer buf = new StringBuffer(Messages.getString("BoardView1.Height")); //$NON-NLS-1$ - // Each hex of a building has its own elevation. - buf.append(mhex.terrainLevel(Terrains.BLDG_ELEV)); - buf.append(" "); //$NON-NLS-1$ - buf.append(bldg.toString()); - buf.append(Messages.getString("BoardView1.CF")); //$NON-NLS-1$ - buf.append(bldg.getCurrentCF(mcoords)); - buf.append(Messages.getString("BoardView1.BldgArmor")); //$NON-NLS-1$ - buf.append(bldg.getArmor(mcoords)); - strings[stringsIndex] = buf.toString(); - stringsIndex += 1; + // in the map editor, the building might not exist + if (bldg != null) { + StringBuffer buf = new StringBuffer(Messages.getString("BoardView1.Height")); //$NON-NLS-1$ + // Each hex of a building has its own elevation. + buf.append(mhex.terrainLevel(Terrains.BLDG_ELEV)); + buf.append(" "); //$NON-NLS-1$ + buf.append(bldg.toString()); + buf.append(Messages.getString("BoardView1.CF")); //$NON-NLS-1$ + buf.append(bldg.getCurrentCF(mcoords)); + buf.append(Messages.getString("BoardView1.BldgArmor")); //$NON-NLS-1$ + buf.append(bldg.getArmor(mcoords)); + strings[stringsIndex] = buf.toString(); + stringsIndex += 1; + } } // Do we have a bridge? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |