bug fix: not painting null radio connections

This commit is contained in:
fros4943 2006-10-05 15:13:48 +00:00
parent ddb3726e7f
commit f08064c3b2

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: VisTraffic.java,v 1.1 2006/08/21 12:13:07 fros4943 Exp $ * $Id: VisTraffic.java,v 1.2 2006/10/05 15:13:48 fros4943 Exp $
*/ */
package se.sics.cooja.plugins; package se.sics.cooja.plugins;
@ -85,7 +85,8 @@ public class VisTraffic extends Visualizer2D {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f));
if (radioMedium != null && radioMedium.getLastTickConnections() != null) { if (radioMedium != null && radioMedium.getLastTickConnections() != null) {
for (RadioConnection conn: radioMedium.getLastTickConnections()) { for (RadioConnection conn: radioMedium.getLastTickConnections()) {
paintConnection(conn, g2d); if (conn != null)
paintConnection(conn, g2d);
} }
} }
getCurrentCanvas().repaint(); getCurrentCanvas().repaint();