From 6c4b3501f395f87aa812523119a7579febcdd144 Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Thu, 17 Dec 2009 16:44:39 +0000 Subject: [PATCH] git-svn-id: https://svn.coded.pt/svn/SIPRP@1148 bb69d46d-e84e-40c8-a05a-06db0d633741 --- .../src/siprp/higiene/relatorio/PanelRelatorio.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PanelRelatorio.java b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PanelRelatorio.java index 2bd02548..12a79d05 100644 --- a/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PanelRelatorio.java +++ b/trunk/SIPRPSoft/src/siprp/higiene/relatorio/PanelRelatorio.java @@ -415,7 +415,10 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe RelatorioPDFCreator creator = new RelatorioPDFCreator(); pdf = creator.createPDF( relatorio.getId() ); } - printToFile( pdf ); + if( !printToFile( pdf ) ) + { + throw new Exception( "ERRO: NULL " + ( plano ? "p " : "r " ) + relatorio.getId() ); + } } catch( Exception e ) { @@ -427,7 +430,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe } } - private void printToFile( byte [] pdf ) throws IOException + private boolean printToFile( byte [] pdf ) throws IOException { if( pdf != null ) @@ -454,6 +457,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe } } } + return pdf != null; } private JFrame getFrame( )