OneTicketPerRequestor: Handle more YAML errors.
This avoids dying in cases where the YAML file is empty or malformed.
This commit is contained in:
parent
325c5ceaf6
commit
727d9d5659
1 changed files with 2 additions and 4 deletions
|
@ -18,10 +18,8 @@ my $plugin_self = RT::Plugin->new(name => "RT-Extension-Conservancy");
|
||||||
foreach my $confdir ($plugin_self->Path("etc"), $RT::LocalEtcPath, $RT::EtcPath) {
|
foreach my $confdir ($plugin_self->Path("etc"), $RT::LocalEtcPath, $RT::EtcPath) {
|
||||||
next unless (defined($confdir) && $confdir);
|
next unless (defined($confdir) && $confdir);
|
||||||
my $conf_path = "$confdir/OneTicketPerRequestor.yml";
|
my $conf_path = "$confdir/OneTicketPerRequestor.yml";
|
||||||
if (-r $conf_path) {
|
eval { %QUEUES = %{YAML::Tiny->read($conf_path)->[0]} };
|
||||||
%QUEUES = %{YAML::Tiny->read($conf_path)->[0]};
|
last if (%QUEUES);
|
||||||
last if (%QUEUES);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compile the user's configuration into arguments for RT::Tickets->OrderBy.
|
# Compile the user's configuration into arguments for RT::Tickets->OrderBy.
|
||||||
|
|
Loading…
Reference in a new issue