Avoid reading field twice (may lead to spurious NPEs).

This commit is contained in:
Simone Bordet 2012-03-06 18:09:58 +01:00
parent 386249f504
commit ffdcfa5dde
1 changed files with 5 additions and 4 deletions

View File

@ -687,8 +687,9 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
{
try
{
if (_key!=null)
_key.cancel();
SelectionKey key = _key;
if (key!=null)
key.cancel();
}
catch (Throwable e)
{