Author: dbkr
Date: 2006-05-28 16:03:00 +0000 (Sun, 28 May 2006)
New Revision: 8898
Modified:
trunk/freenet/src/freenet/clients/http/PageMaker.java
Log:
Getting a directory as a resource doesn't seem to work in GCJ, so don't rely on
it. Just check that themes exist rather than building the list and checking
that it contains the theme.
Modified: trunk/freenet/src/freenet/clients/http/PageMaker.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/PageMaker.java 2006-05-28
03:50:00 UTC (rev 8897)
+++ trunk/freenet/src/freenet/clients/http/PageMaker.java 2006-05-28
16:03:00 UTC (rev 8898)
@@ -26,10 +26,14 @@
public List jarThemesCache = null;
PageMaker(String t) {
- if (t == null || !this.getThemes().contains(t)) {
+ if (t == null) {
this.theme = DEFAULT_THEME;
} else {
- this.theme = t;
+ URL themeurl =
getClass().getResource("staticfiles/themes/"+t+"/theme.css");
+ if (themeurl == null)
+ this.theme = DEFAULT_THEME;
+ else
+ this.theme = t;
}
}
@@ -136,6 +140,8 @@
}
} catch (IOException ioe1) {
Logger.error(this, "error creating list of themes",
ioe1);
+ } catch (NullPointerException npe) {
+ Logger.error(this, "error creating list of themes",
npe);
} finally {
if (!themes.contains("aqua")) {
themes.add("aqua");