From 011761076d21bbc4c82ed515b7242209675863e2 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 12 Oct 2008 14:03:19 +0000 Subject: [PATCH] ThePimp: do not attempt to save a file if there is no open image. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2931 92316355-f0b4-4df1-b90c-862c8a59935f --- ThePimp/MainWindow.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ThePimp/MainWindow.cs b/ThePimp/MainWindow.cs index e8d27d9..0ce2c09 100644 --- a/ThePimp/MainWindow.cs +++ b/ThePimp/MainWindow.cs @@ -50,7 +50,7 @@ namespace ThePimp } while(notebook1.NPages > 0) - notebook1.RemovePage(0); + notebook1.RemovePage(0); int n = notebook1.AppendPage(new PictureView(p), new Label(p.FileName)); notebook1.Page = n; @@ -86,6 +86,8 @@ namespace ThePimp protected virtual void OnSaveAsActionActivated (object sender, System.EventArgs e) { + if(notebook1.NPages <= 0) + return; SaveFile save = new SaveFile(); PictureView view = notebook1.CurrentPageWidget as PictureView; save.Save(view.Picture);