--- trunk/lib/WOPI.pm 2004/06/25 20:51:16 6 +++ trunk/lib/WOPI.pm 2004/07/06 22:21:35 7 @@ -40,6 +40,8 @@ sub last_order { my $self = shift; + return 0 if (! defined $self->{'poll'}->{'questions'}); + return scalar @{$self->{'poll'}->{'questions'}} || 0; } @@ -154,7 +156,8 @@ # print "v = ",Dumper(\%v); my $o = $self->{'cgi'}->param('order'); - die "no order?" if (! defined($o)); + confess "no order?" if (! defined($o)); + confess "order not number? [$o]" if ($o !~ /^\d+$/); if (! $self->{'cgi'}->param('save')) { $self->status("No save button, won't save question $o"); @@ -175,6 +178,8 @@ $self->{'poll'}->{'questions'}->[$o] = $question; + confess "question $0 not saved" if (! $self->{'poll'}->{'questions'}->[$o]); + $self->editor(); }