Commits

mickael9 committed 96a8240

Fix exception while showing search results when a share has no title.

Comments (0)

Files changed (1)

             print('Found %d share(s):' % len(found_in_shares))
 
             for share in found_in_shares:
-                print(' - %s  %s%s' % (share.url.ljust(max_url), ' '*(maximax-max_url), shorten(share.title, 75 - max_url)))
+                print(' - %s  %s%s' % (share.url.ljust(max_url), ' '*(maximax-max_url), shorten(share.title or '', 75 - max_url)))
         else:
             print('Nothing found in shares.')
 
             print('Found %d file(s):' % sum(map(len, found_in_files.values())))
 
             for share, files in found_in_files.items():
-                print(' - Share %s  %s%s' % (share.url.ljust(max_url_shares), ' '*(maximax-max_url_shares-6), shorten(share.title, 69 - max_url_shares)))
+                print(' - Share %s  %s%s' % (share.url.ljust(max_url_shares), ' '*(maximax-max_url_shares-6), shorten(share.title or '', 69 - max_url_shares)))
 
                 for file in files:
                     print('    - %s  %s%s' % (file.url.ljust(max_url_files), ' '*(maximax-max_url_files-6), shorten(file.name, 72 - max_url_files)))