mirror of
https://github.com/jopohl/urh.git
synced 2026-03-19 14:46:49 +01:00
avoid crash in docker, due to UnicodeEncodeError
This commit is contained in:
@@ -13,8 +13,12 @@ class FileIconProvider(QFileIconProvider):
|
||||
|
||||
def icon(self, arg):
|
||||
if isinstance(arg, QFileInfo):
|
||||
if (arg.isDir() and os.path.isfile(os.path.join(arg.filePath(), constants.PROJECT_FILE))) \
|
||||
or (arg.isFile() and arg.fileName() == constants.PROJECT_FILE):
|
||||
return QIcon(":/icons/icons/appicon.png")
|
||||
try:
|
||||
if (arg.isDir() and os.path.isfile(os.path.join(arg.filePath(), constants.PROJECT_FILE))) \
|
||||
or (arg.isFile() and arg.fileName() == constants.PROJECT_FILE):
|
||||
return QIcon(":/icons/icons/appicon.png")
|
||||
except:
|
||||
# In some environments (e.g. docker) there tend to be encoding errors
|
||||
pass
|
||||
|
||||
return super().icon(arg)
|
||||
|
||||
Reference in New Issue
Block a user