From: theAdib Date: Sun, 10 May 2009 12:54:49 +0000 (+0000) Subject: BUG 218090 opening of bitmap fails, now error message X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5dd830b36c5b7404e81a71bdfddeecab4e0a5e4d;p=inkscape.git BUG 218090 opening of bitmap fails, now error message --- diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 0acf1648c..64a099c8a 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -19,10 +19,11 @@ namespace Internal { SPDocument * GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) { - SPDocument *doc = sp_document_new(NULL, TRUE, TRUE); + SPDocument *doc = NULL; GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL ); if (pb) { /* We are readable */ + doc = sp_document_new(NULL, TRUE, TRUE); bool saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, false); // no need to undo in this temporary document diff --git a/src/extension/system.cpp b/src/extension/system.cpp index fdebd7b22..a7828d3fc 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -93,7 +93,7 @@ open(Extension *key, gchar const *filename) SPDocument *doc = imod->open(filename); if (!doc) { - return NULL; + throw Input::open_failed(); } if (last_chance_svg) {