[Rt-commit] rt branch, 4.4/undef-default-catalog, created. rt-4.4.0rc1-5-ge525b1a

Shawn Moore shawn at bestpractical.com
Thu Nov 19 15:29:56 EST 2015


The branch, 4.4/undef-default-catalog has been created
        at  e525b1a7127a1b0dff577ab39c4a2a6e40acfe45 (commit)

- Log -----------------------------------------------------------------
commit e525b1a7127a1b0dff577ab39c4a2a6e40acfe45
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Nov 19 20:29:24 2015 +0000

    Avoid returning undef for default catalog
    
        Fixes: I#31422

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index bbc3d29..ab13a43 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -4092,7 +4092,8 @@ sub LoadDefaultCatalog {
         # If no catalog, default to the first active catalog
         my $catalogs = RT::Catalogs->new($session{CurrentUser});
         $catalogs->UnLimit;
-        $catalog_obj = $catalogs->First();
+        my $candidate = $catalogs->First;
+        $catalog_obj = $candidate if $candidate;
         RT::Logger->error("No active catalogs.")
             unless $catalog_obj and $catalog_obj->Id;
     }

-----------------------------------------------------------------------


More information about the rt-commit mailing list