]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/ProcFSTools.pm
add missing check for undef in is_mounted
[pve-common.git] / src / PVE / ProcFSTools.pm
index 516c0e8b939791a64771df41c36df362e65c7423..eadb4e6cda52abf1dc83a7432d33aaad00cffa00 100644 (file)
@@ -323,6 +323,8 @@ sub is_mounted {
 
     $mountpoint = Cwd::realpath($mountpoint);
 
 
     $mountpoint = Cwd::realpath($mountpoint);
 
+    return 0 if !defined($mountpoint); # path does not exist
+
     my $mounts = parse_proc_mounts();
     return (grep { $_->[1] eq $mountpoint } @$mounts) ? 1 : 0;
 }
     my $mounts = parse_proc_mounts();
     return (grep { $_->[1] eq $mountpoint } @$mounts) ? 1 : 0;
 }