Fixing up a regexp to stop a trivial warn
[koha.git] / misc / migration_tools / bulkmarcimport.pl
index 2f18d52..3bb9ed8 100755 (executable)
@@ -206,9 +206,10 @@ RECORD: while (  ) {
             }
         } else {
             if (my $f020 = $record->field('020')) {
-                $isbn = $f020->subfield('a');
-                $isbn =~ s/-//g;
-                $f020->update('a' => $isbn);
+                if ($isbn = $f020->subfield('a')) {
+                    $isbn =~ s/-//g;
+                    $f020->update('a' => $isbn);
+                }
             }
         }
     }