Make sure a non-null theme is returned.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / AbstractCmsApp.java
index 2ecc658413507860381d30f238e7019a1dd29350..e760a101820f16d87b61ccdf260045c050456a50 100644 (file)
@@ -25,6 +25,8 @@ public abstract class AbstractCmsApp implements CmsApp {
                String themeId = getThemeId(uiName);
                if (themeId == null)
                        return null;
+               if (!themes.containsKey(themeId))
+                       throw new IllegalArgumentException("Theme " + themeId + " not found.");
                return themes.get(themeId);
        }