emojifs icon indicating copy to clipboard operation
emojifs copied to clipboard

graceful handling of garbage aliases

Open cdanis opened this issue 4 years ago • 2 comments

This emoji object exists in the wild and currently makes readdir() on the Slack's directory throw:

      File "/home/cdanis/personal/emojifs/emojifs/slack.py", line 172, in _emoji_to_filename
        if e['url'].startswith('http'):
    AttributeError: 'NoneType' object has no attribute 'startswith'
{
    "name": "sol_ring",
    "is_alias": 1,
    "alias_for": "",
    "url": null,
    "created": 1477339155,
    "team_id": "Txxxxx",
    "user_id": "Uxxxxx",
    "user_display_name": "jxxxx",
    "avatar_hash": "1xxxxx",
    "can_delete": true,
    "is_bad": false,
    "synonyms": [
        "",
        "sol_ring"
    ]
}

It probably should be rendered as a dangling symlink, with no extension.

cdanis avatar Jul 19 '20 14:07 cdanis

@kprevas I think you fixed this exact issue...?

cdanis avatar Mar 11 '21 17:03 cdanis

yep!

kprevas avatar Mar 13 '21 14:03 kprevas