mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 01:05:48 +02:00
fix possible NullPointerException
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user