}\r
\r
@Override\r
- public Limit<T> getLimit(String presetName) {\r
-\r
+ public synchronized Limit<T> getLimit(String presetName) {\r
+ // Assume this function is called for the first time and thus need\r
+ // initialization\r
if (limits == null) {\r
limits = getLimits();\r
}\r
+ // Either the initialization failed or limits were not configured.\r
+ if (limits == null) {\r
+ return null;\r
+ }\r
\r
Limit<T> limit = null;\r
if (limits != null) {\r