Bug 14544: Handle database error when creating a shelf with DB admin account
[koha.git] / Koha / Virtualshelf.pm
index d80f249..7ce2738 100644 (file)
@@ -51,6 +51,10 @@ our $PUBLIC = 2;
 sub store {
     my ( $self ) = @_;
 
+    unless ( $self->owner ) {
+        Koha::Exceptions::Virtualshelves::UseDbAdminAccount->throw;
+    }
+
     unless ( $self->is_shelfname_valid ) {
         Koha::Exceptions::Virtualshelves::DuplicateObject->throw;
     }