condemil / gist

Sublime Text plugin for creating new Gists from selected text
MIT License
725 stars 136 forks source link

Move gist_title function call after condition #160

Closed vkzawa closed 7 years ago

vkzawa commented 9 years ago

When running 'Gist: Open Gist' from the Sublime Text Command Palette I get an error: "error: Gist: unknown error (please, report a bug!)" The console shows a 'IndexError: list index out of range' on line 46.

This happens when a gist contains no files, which is not possible through github.com, but it IS possible with this plugin by opening a Gist and choosing 'Gist: Delete Gist File' from the Command Palette.

The proposed fix ensures gist_title is not called unless the gist has 'files'.