From abf03414c37cb3d8d0591edb2408b60be7cf252e Mon Sep 17 00:00:00 2001 From: Adrien Saurat Date: Tue, 3 Apr 2012 09:56:46 +0200 Subject: [PATCH] Bug 7871: prevents crash when suggestion linked to erased budget Signed-off-by: Chris Cormack Signed-off-by: Paul Poulain --- suggestion/suggestion.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 7f197d8b69..f7c50b50ff 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -205,7 +205,10 @@ if ($op=~/else/) { my $suggestions = &SearchSuggestion($suggestion_ref); foreach my $suggestion (@$suggestions) { - $suggestion->{budget_name} = GetBudget( $suggestion->{budgetid} )->{budget_name} if $suggestion->{budgetid}; + if ($suggestion->{budgetid}){ + my $bud = GetBudget( $suggestion->{budgetid} ); + $suggestion->{budget_name} = $bud->{budget_name} if $bud; + } foreach my $date qw(suggesteddate manageddate accepteddate) { if ($suggestion->{$date} and $suggestion->{$date} ne "0000-00-00" && $suggestion->{$date} ne "" ) { $suggestion->{$date} = format_date( $suggestion->{$date} );