Fixed possible MatchingRoomManager NPE.

This commit is contained in:
MobiusDev 2017-09-10 00:31:25 +00:00
parent 906cb678c7
commit a999913ad5
4 changed files with 52 additions and 4 deletions

View File

@ -68,7 +68,19 @@ public class MatchingRoomManager
public List<L2PcInstance> getPlayerInWaitingList(int minLevel, int maxLevel, List<ClassId> classIds, String query)
{
return _waitingList == null ? Collections.emptyList() : _waitingList.stream().filter(p -> (p.getLevel() >= minLevel) && (p.getLevel() <= maxLevel)).filter(p -> (classIds == null) || classIds.contains(p.getClassId())).filter(p -> query.isEmpty() || p.getName().toLowerCase().contains(query)).collect(Collectors.toList());
if (_waitingList == null)
{
return Collections.emptyList();
}
return _waitingList.stream() //
.filter(p -> (p != null) //
&& (p.getLevel() >= minLevel) //
&& (p.getLevel() <= maxLevel) //
).filter(p -> (classIds == null) //
|| classIds.contains(p.getClassId()) //
).filter(p -> query.isEmpty() //
|| p.getName().toLowerCase().contains(query) //
).collect(Collectors.toList());
}
public int addMatchingRoom(MatchingRoom room)

View File

@ -68,7 +68,19 @@ public class MatchingRoomManager
public List<L2PcInstance> getPlayerInWaitingList(int minLevel, int maxLevel, List<ClassId> classIds, String query)
{
return _waitingList == null ? Collections.emptyList() : _waitingList.stream().filter(p -> (p.getLevel() >= minLevel) && (p.getLevel() <= maxLevel)).filter(p -> (classIds == null) || classIds.contains(p.getClassId())).filter(p -> query.isEmpty() || p.getName().toLowerCase().contains(query)).collect(Collectors.toList());
if (_waitingList == null)
{
return Collections.emptyList();
}
return _waitingList.stream() //
.filter(p -> (p != null) //
&& (p.getLevel() >= minLevel) //
&& (p.getLevel() <= maxLevel) //
).filter(p -> (classIds == null) //
|| classIds.contains(p.getClassId()) //
).filter(p -> query.isEmpty() //
|| p.getName().toLowerCase().contains(query) //
).collect(Collectors.toList());
}
public int addMatchingRoom(MatchingRoom room)

View File

@ -68,7 +68,19 @@ public class MatchingRoomManager
public List<L2PcInstance> getPlayerInWaitingList(int minLevel, int maxLevel, List<ClassId> classIds, String query)
{
return _waitingList == null ? Collections.emptyList() : _waitingList.stream().filter(p -> (p.getLevel() >= minLevel) && (p.getLevel() <= maxLevel)).filter(p -> (classIds == null) || classIds.contains(p.getClassId())).filter(p -> query.isEmpty() || p.getName().toLowerCase().contains(query)).collect(Collectors.toList());
if (_waitingList == null)
{
return Collections.emptyList();
}
return _waitingList.stream() //
.filter(p -> (p != null) //
&& (p.getLevel() >= minLevel) //
&& (p.getLevel() <= maxLevel) //
).filter(p -> (classIds == null) //
|| classIds.contains(p.getClassId()) //
).filter(p -> query.isEmpty() //
|| p.getName().toLowerCase().contains(query) //
).collect(Collectors.toList());
}
public int addMatchingRoom(MatchingRoom room)

View File

@ -68,7 +68,19 @@ public class MatchingRoomManager
public List<L2PcInstance> getPlayerInWaitingList(int minLevel, int maxLevel, List<ClassId> classIds, String query)
{
return _waitingList == null ? Collections.emptyList() : _waitingList.stream().filter(p -> (p.getLevel() >= minLevel) && (p.getLevel() <= maxLevel)).filter(p -> (classIds == null) || classIds.contains(p.getClassId())).filter(p -> query.isEmpty() || p.getName().toLowerCase().contains(query)).collect(Collectors.toList());
if (_waitingList == null)
{
return Collections.emptyList();
}
return _waitingList.stream() //
.filter(p -> (p != null) //
&& (p.getLevel() >= minLevel) //
&& (p.getLevel() <= maxLevel) //
).filter(p -> (classIds == null) //
|| classIds.contains(p.getClassId()) //
).filter(p -> query.isEmpty() //
|| p.getName().toLowerCase().contains(query) //
).collect(Collectors.toList());
}
public int addMatchingRoom(MatchingRoom room)