From 5ff47fc40c2e6be3e10eb5aef0a7dfcd8ac03b16 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 22 Jul 2024 19:02:22 +0000 Subject: [PATCH] Bug 28762: (QA follow-up) Restore protection against unknown itemtypes Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- Koha/Item.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 64c18e47f4..45a4f43cf3 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -1843,7 +1843,8 @@ Returns the effective not for loan status of the item sub effective_not_for_loan_status { my ($self) = @_; - my $itype_notforloan = $self->itemtype->notforloan; + my $itemtype = $self->itemtype; + my $itype_notforloan = $itemtype ? $itemtype->notforloan : undef; return ( defined($itype_notforloan) && !$self->notforloan ) ? $itype_notforloan : $self->notforloan; } -- 2.39.5