Merge "[hprof-conv] Check for NULL before closing descriptors"
diff --git a/tools/hprof-conv/HprofConv.c b/tools/hprof-conv/HprofConv.c
index a69440c..cc90176 100644
--- a/tools/hprof-conv/HprofConv.c
+++ b/tools/hprof-conv/HprofConv.c
@@ -764,9 +764,9 @@
     res = 2;
 
 finish:
-    if (in != stdin)
+    if (in != stdin && in != NULL)
         fclose(in);
-    if (out != stdout)
+    if (out != stdout && out != NULL)
         fclose(out);
     return res;
 }