Check if 'mnt_namespace' has the 'ns' member before using it

This commit is contained in:
Gustavo Moreira
2023-04-26 00:36:58 +10:00
parent 33f54f8cf7
commit b2d33c2cb0
@@ -825,7 +825,7 @@ class mnt_namespace(objects.StructType):
def get_inode(self):
if self.has_member("proc_inum"):
return self.proc_inum
elif self.ns.has_member("inum"):
elif self.has_member("ns") and self.ns.has_member("inum"):
return self.ns.inum
else:
raise AttributeError("Unable to find mnt_namespace inode")