From 1144b8de3ddefe71434bfcddac091f63bdbe1834 Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Tue, 2 Aug 2011 13:55:29 +0000 Subject: [PATCH] checking attribute existance before referencing it git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@478 96b47cad-a561-4643-ad3b-153ac7d7599c --- .../src/vpicc/virtualsmartcard/SmartcardFilesystem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py b/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py index d9b0567..b93c4a5 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/SmartcardFilesystem.py @@ -476,9 +476,9 @@ class DF(File): # {{{ for i in indexes: file = self.content[i] - if ((hasattr(file, attribute) and getattr(file, attribute)==value) + if (hasattr(file, attribute) and ((getattr(file, attribute)==value) or (attribute == 'dfname' and getattr(file, - attribute).startswith(value))): + attribute).startswith(value)))): return file # not found if isinstance(value, int):