From 582ebbb6b9324de28c7bbda824474d88d4b9889e 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 --- suggestion/suggestion.pl | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 7f197d8..f7c50b5 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} ); -- 1.7.5.4