summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Component.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Component.pm')
-rw-r--r--Bugzilla/Component.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm
index 215119715..ceca7e794 100644
--- a/Bugzilla/Component.pm
+++ b/Bugzilla/Component.pm
@@ -155,6 +155,11 @@ sub remove_from_db {
$dbh->bz_start_transaction();
+ # Products must have at least one component.
+ if (scalar(@{$self->product->components}) == 1) {
+ ThrowUserError('component_is_last', { comp => $self });
+ }
+
if ($self->bug_count) {
if (Bugzilla->params->{'allowbugdeletion'}) {
require Bugzilla::Bug;