throw IllegalStateException rather than NPE if no context
This commit is contained in:
@ -19,6 +19,9 @@ public class CSSHelper extends HelperBase {
|
|||||||
if (userAgent != null && userAgent.contains("MSIE")) {
|
if (userAgent != null && userAgent.contains("MSIE")) {
|
||||||
url += FORCE + "/";
|
url += FORCE + "/";
|
||||||
} else {
|
} else {
|
||||||
|
// This is the first thing to use _context on most pages
|
||||||
|
if (_context == null)
|
||||||
|
throw new IllegalStateException("No contexts. This is usually because the router is either starting up or shutting down.");
|
||||||
String theme = _context.getProperty(PROP_THEME_NAME, DEFAULT_THEME);
|
String theme = _context.getProperty(PROP_THEME_NAME, DEFAULT_THEME);
|
||||||
url += theme + "/";
|
url += theme + "/";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user