From 2e763ba0aad6d2f05506c136c87b8fdc8ed07074 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 19 Sep 2018 15:45:06 +0200 Subject: [PATCH] fix: [ModulesInformationV2] fix #244 --- bin/ModulesInformationV2.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/ModulesInformationV2.py b/bin/ModulesInformationV2.py index 36b397ca..30a24f15 100755 --- a/bin/ModulesInformationV2.py +++ b/bin/ModulesInformationV2.py @@ -724,13 +724,15 @@ def format_string(tab, padding_row): text="" for ite, elem in enumerate(the_array): - if len(elem) > padding_row[ite]: - text += "*" + elem[-padding_row[ite]+6:] - padd_off = " "*5 - else: - text += elem - padd_off = " "*0 - text += (padding_row[ite] - len(elem))*" " + padd_off + if elem is not None and type(elem) is str: + if len(elem) > padding_row[ite]: + text += "*" + elem[-padding_row[ite]+6:] + padd_off = " "*5 + else: + text += elem + padd_off = " "*0 + text += (padding_row[ite] - len(elem))*" " + padd_off + printstring.append( (text, the_pid) ) return printstring