Throw an exception when the node is not connected.
[jSite.git] / src / de / todesbaum / jsite / application / Freenet7Interface.java
index d670fd2..ae5c967 100644 (file)
@@ -47,8 +47,8 @@ public class Freenet7Interface {
        private Connection connection;
 
        /**
-        * Sets the hostname of the node. The default port for FCP2 connections (
-        * {@link Node#DEFAULT_PORT}) is used.
+        * Sets the hostname of the node. The default port for FCP2 connections ({@link Node#DEFAULT_PORT})
+        * is used.
         *
         * @param hostname
         *            The hostname of the node
@@ -142,7 +142,7 @@ public class Freenet7Interface {
         */
        public String[] generateKeyPair() throws IOException {
                if (!isNodePresent()) {
-                       return null;
+                       throw new IOException("Node is offline.");
                }
                GenerateSSK generateSSK = new GenerateSSK();
                Client client = new Client(connection, generateSSK);