From dc46b2873e4fda4096683b807a7f2ae5e2506bc3 Mon Sep 17 00:00:00 2001 From: Photon89 Date: Wed, 19 Aug 2026 10:32:26 +0200 Subject: [PATCH] Add proper error handling if Path::Class is missing --- bin/shutter | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/shutter b/bin/shutter index 58a42940..53c9433a 100755 --- a/bin/shutter +++ b/bin/shutter @@ -197,6 +197,7 @@ my $nautilus_sendto = TRUE; my $goocanvas = TRUE; my $exiftool = TRUE; my $appindicator = TRUE; +my $pathclass = TRUE; fct_init_depend(); #-------------------------------------- @@ -8359,6 +8360,9 @@ sub STARTUP { #parse filename my ($name, $folder, $type) = fileparse($ukey, qr/\.[^.]*/); + #skip Imgur if optional dependency Path::Class not met + next if ($name eq 'Imgur' && !$pathclass); + #~ print $name, $folder, $type, "\n"; if ( !exists $accounts{$name} @@ -9392,6 +9396,13 @@ sub STARTUP { $exiftool = FALSE; } + #Path::Class + eval { require Path::Class }; + if ($@) { + warn "WARNING: Path::Class is missing --> uploading to Imgur will be disabled!\n\n"; + $pathclass = FALSE; + } + #dev-libs/libappindicator[introspection] eval { Glib::Object::Introspection->setup(