From: amwaterhouse Date: Mon, 12 Dec 2005 13:31:29 +0000 (+0000) Subject: Check if user cancelled before making image X-Git-Tag: Release_2_07~9 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=eda4e3368f30e54448e303c51d0cb717aed57f90;p=jalview.git Check if user cancelled before making image --- 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."); + } } }