]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
v2writable: don't attempt to print defrag progress w/o -v
authorEric Wong <e@80x24.org>
Tue, 2 Sep 2025 07:21:18 +0000 (07:21 +0000)
committerEric Wong <e@80x24.org>
Wed, 3 Sep 2025 08:59:55 +0000 (08:59 +0000)
Otherwise we'd crash when attempting to use `undef' as a
subroutine reference :x

lib/PublicInbox/V2Writable.pm

index bd5d9d320a72d53fa1c69d7f3aa823f764a54a92..aea215cff0e626ccd6011f2ef6d949a59308cc46 100644 (file)
@@ -531,7 +531,7 @@ sub do_defrag ($) {
                $pr->('defrag took ',
                        sprintf('%ums', now - $t0),
                        ", next defrag: >=#$self->{defrag_at} ",
-                       "(cur: $self->{oidx}->{-art_max})\n");
+                       "(cur: $self->{oidx}->{-art_max})\n") if $pr;
        } else { # defrag not supported (or needed, maybe)
                delete $self->{defrag_at};
        }