From 2828ee690f899a083148d402550c686893a422cc Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Fri, 22 Apr 2005 17:43:50 +0000 Subject: [PATCH] NameFinder.java (close): IN, OUT, and PROC can all be null, check for that case and don't deference it. 2005-04-22 Andrew Pinski * gnu/gcj/runtime/NameFinder.java (close): IN, OUT, and PROC can all be null, check for that case and don't deference it. From-SVN: r98573 --- libjava/ChangeLog | 5 +++++ libjava/gnu/gcj/runtime/NameFinder.java | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index b85cdf23eaa..1a9c0ba31bc 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2005-04-22 Andrew Pinski + + * gnu/gcj/runtime/NameFinder.java (close): IN, OUT, and PROC can all + be null, check for that case and don't deference it. + 2005-04-22 Sven de Marothy * java/util/logging/LogManager.java: Reformatted. diff --git a/libjava/gnu/gcj/runtime/NameFinder.java b/libjava/gnu/gcj/runtime/NameFinder.java index 5469f08168d..4c629bb22ec 100644 --- a/libjava/gnu/gcj/runtime/NameFinder.java +++ b/libjava/gnu/gcj/runtime/NameFinder.java @@ -86,12 +86,14 @@ public class NameFinder { try { - in.close(); - out.close(); + if (in != null) + in.close(); + if (out != null) + out.close(); } catch (IOException x) {} - - proc.destroy(); + if (proc != null) + proc.destroy(); } }