From bb7fd9624b935a2edae7dc29864a95e7b6dfbdbe Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Wed, 19 Sep 2001 18:28:59 +0000 Subject: Fix null pointer bug. From-SVN: r45692 --- libjava/gnu/gcj/protocol/file/Handler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libjava/gnu') diff --git a/libjava/gnu/gcj/protocol/file/Handler.java b/libjava/gnu/gcj/protocol/file/Handler.java index b12ebd42b29..b4d8fbfbe42 100644 --- a/libjava/gnu/gcj/protocol/file/Handler.java +++ b/libjava/gnu/gcj/protocol/file/Handler.java @@ -32,7 +32,8 @@ public class Handler extends URLStreamHandler { // If a hostname is set, then we need to switch protocols to ftp // in order to transfer this from the remote host. - if (! url.getHost().equals("")) + String host = url.getHost(); + if ((host != null) && (! host.equals(""))) { // Reset the protocol (and implicitly the handler) for this URL. // Then have the URL attempt the connection again, as it will -- cgit v1.2.1