From eda4e3368f30e54448e303c51d0cb717aed57f90 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 12 Dec 2005 13:31:29 +0000 Subject: [PATCH] Check if user cancelled before making image --- src/jalview/util/ImageMaker.java | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/jalview/util/ImageMaker.java b/src/jalview/util/ImageMaker.java index 02427f2..59244eb 100755 --- a/src/jalview/util/ImageMaker.java +++ b/src/jalview/util/ImageMaker.java @@ -49,19 +49,22 @@ public class ImageMaker } } - try + if(file!=null) { - out = new FileOutputStream(file); + try + { + out = new FileOutputStream(file); - if (type == EPS) - setupEPS(width, height, EPStitle); - else - setupPNG(width, height); - } - catch (Exception ex) - { - System.out.println("Error creating " + (type == EPS ? "EPS" : "PNG") + - " file."); + if (type == EPS) + setupEPS(width, height, EPStitle); + else + setupPNG(width, height); + } + catch (Exception ex) + { + System.out.println("Error creating " + (type == EPS ? "EPS" : "PNG") + + " file."); + } } } -- 1.7.10.2