Default db_strvalue to None if nonexistent

This commit is contained in:
Wendy Wang 2024-09-27 23:04:30 +02:00
parent 389a212c63
commit 3a093e134c
2 changed files with 3 additions and 3 deletions

View file

@ -2831,7 +2831,7 @@ class CmdExamine(ObjManipCommand):
key, category, value = attr.db_key, attr.db_category, attr.value
valuetype = ""
if value is None and getattr(attr, "strvalue", None) is not None:
if value is None and attr.strvalue is not None:
value = attr.strvalue
valuetype = " |B[strvalue]|n"
typ = self._get_attribute_value_type(value)
@ -2850,7 +2850,7 @@ class CmdExamine(ObjManipCommand):
key, category, value = attr.db_key, attr.db_category, attr.value
valuetype = ""
if value is None and getattr(attr, "strvalue", None) is not None:
if value is None and attr.strvalue is not None:
value = attr.strvalue
valuetype = " |B[strvalue]|n"
typ = self._get_attribute_value_type(value)

View file

@ -62,7 +62,7 @@ class IAttribute:
return LockHandler(self)
key = property(lambda self: self.db_key)
strvalue = property(lambda self: self.db_strvalue)
strvalue = property(lambda self: getattr(self, 'db_strvalue', None))
category = property(lambda self: self.db_category)
model = property(lambda self: self.db_model)
attrtype = property(lambda self: self.db_attrtype)