scstadmin: Avoid dereferencing variables that have the value undef

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7950 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-02-18 00:38:50 +00:00
parent 27d90a3563
commit c4cc4bdcbc

View File

@@ -777,6 +777,7 @@ sub aluaAttributes {
chomp $value;
my $second_line = <$io>;
$second_line = "" if (!defined($second_line));
if (new_sysfs_interface() && !$is_static
|| ($second_line =~ /\[key\]/)) {
my $key = 0;
@@ -2633,6 +2634,7 @@ sub deviceAttributes {
} elsif ($linked =~ /^(\.\.\/)*$t\/([^\/]+)\/([^\/]+)\/$l\/(\d+)$/) {
$driver = $2;
$target = $3;
$group = "";
$lun = $4;
} else {
print("internal error: could not parse $linked\n");