fix possible NullPointerException

This commit is contained in:
Sebastian Sdorra
2011-11-06 18:14:58 +01:00
parent 919cccd8f6
commit b2459d1222

View File

@@ -78,8 +78,21 @@ public class PluginInformationComparator
if (result == 0)
{
result = plugin.getState().getCompareValue()
- other.getState().getCompareValue();
PluginState state = plugin.getState();
PluginState otherState = other.getState();
if ((state != null) && (otherState != null))
{
result = state.getCompareValue() - otherState.getCompareValue();
}
else if ((state == null) && (otherState != null))
{
result = 1;
}
else if ((state != null) && (otherState == null))
{
result = -1;
}
}
}