From: "Enrico Weigelt, metux IT consult" <enrico.weig...@gr13.net>

---
 src/net/sf/freecol/common/model/NationType.java | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/net/sf/freecol/common/model/NationType.java 
b/src/net/sf/freecol/common/model/NationType.java
index 4ed0c7a2ef1..60dc2b1eeab 100644
--- a/src/net/sf/freecol/common/model/NationType.java
+++ b/src/net/sf/freecol/common/model/NationType.java
@@ -131,8 +131,12 @@ public abstract class NationType extends 
FreeColSpecObjectType {
      * @return The settlement type.
      */
     public SettlementType getSettlementType(boolean isCapital) {
-        return find(getSettlementTypes(),
-                    matchKey(isCapital, SettlementType::isCapital));
+        if (settlementTypes != null)
+            for (SettlementType st : settlementTypes)
+                if (st.isCapital() == isCapital)
+                    return st;
+
+        return null;
     }
 
     /**
@@ -142,8 +146,12 @@ public abstract class NationType extends 
FreeColSpecObjectType {
      * @return The settlement type.
      */
     public SettlementType getSettlementType(String id) {
-        return find(getSettlementTypes(),
-                    matchKeyEquals(id, FreeColObject::getId));
+        if (settlementTypes != null)
+            for (SettlementType st : settlementTypes)
+                if (st.getId().equals(id))
+                    return st;
+
+        return null;
     }
 
     /**
-- 
2.11.0.rc0.7.gbe5a750


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to