#2 NullPointerException when getting the strongest link

v1.0_(example)
closed
m_rbot
5
2007-01-17
2007-01-16
No

The method getStrongestLink in the rbot.client.actor.memory.component.Chunk
throws a NullPointerException if it is called on a chunk, which is connected to other chunks.

The way to correct this would be to replace the line

Link strongestLink = null;

with the lines

Link strongestLink = null;
if (links.isEmpty ()) {
// ERROR: this chunk is not connected to any other
throw ...
}
else {
strongestLink = links.get (0);
}

This bug is related to bug #1636582

Discussion

  • m_rbot
    m_rbot
    2007-01-17

    • assigned_to: nobody --> j_m_rbot
     
  • m_rbot
    m_rbot
    2007-01-17

    • status: open --> closed
     
  • m_rbot
    m_rbot
    2007-01-17

    Logged In: YES
    user_id=1555540
    Originator: NO

    Added a RBotMemoryException to catch nullpointer when chunk has no links. Thanks to Andrzej Wasylkowski.