[freenet-cvs] r16907 - trunk/plugins/KeyExplorer

saces at freenetproject.org saces at freenetproject.org
Sat Jan 5 08:18:42 UTC 2008


Author: saces
Date: 2008-01-05 08:18:42 +0000 (Sat, 05 Jan 2008)
New Revision: 16907

Modified:
   trunk/plugins/KeyExplorer/KeyExplorer.java
Log:
workaround a npe in keyexplorer

Modified: trunk/plugins/KeyExplorer/KeyExplorer.java
===================================================================
--- trunk/plugins/KeyExplorer/KeyExplorer.java	2008-01-05 03:49:37 UTC (rev 16906)
+++ trunk/plugins/KeyExplorer/KeyExplorer.java	2008-01-05 08:18:42 UTC (rev 16907)
@@ -177,13 +177,17 @@
 					if (md.isSingleFileRedirect()) {
 						metaBox.addChild("#", "Document type: SingleFileRedirect");
 						metaBox.addChild("%", "<BR />");
-						String sfrUri = md.getSingleTarget().toString();
-						metaBox.addChild("#", sfrUri);
-						metaBox.addChild("#", "\u00a0");
-						metaBox.addChild(new HTMLNode("a", "href", "/?key="+sfrUri, "open"));
-						metaBox.addChild("#", "\u00a0");
-						metaBox.addChild(new HTMLNode("a", "href", "/plugins/plugins.KeyExplorer.KeyExplorer/?key="+sfrUri, "explore"));
-						metaBox.addChild("%", "<BR />");
+						FreenetURI uri = md.getSingleTarget();
+						// TODO saces need a lesson in manifest structure?
+						if (uri != null) {
+							String sfrUri = md.getSingleTarget().toString();
+							metaBox.addChild("#", sfrUri);
+							metaBox.addChild("#", "\u00a0");
+							metaBox.addChild(new HTMLNode("a", "href", "/?key="+sfrUri, "open"));
+							metaBox.addChild("#", "\u00a0");
+							metaBox.addChild(new HTMLNode("a", "href", "/plugins/plugins.KeyExplorer.KeyExplorer/?key="+sfrUri, "explore"));
+							metaBox.addChild("%", "<BR />");
+						}
 					}
 
 					if (md.isArchiveInternalRedirect()) {




More information about the cvs mailing list