{"action":"closed","issue":{"url":"https://api.github.com/repos/pychess/pychess/issues/829","labels_url":"https://api.github.com/repos/pychess/pychess/issues/829/labels{/name}","comments_url":"https://api.github.com/repos/pychess/pychess/issues/829/comments","events_url":"https://api.github.com/repos/pychess/pychess/issues/829/events","html_url":"https://github.com/pychess/pychess/issues/829","id":56500008,"number":829,"title":"Invalid FEN strings shouldn't crash pychess","user":{"login":"pychess","id":10670522,"avatar_url":"https://avatars.githubusercontent.com/u/10670522?v=3","gravatar_id":"","url":"https://api.github.com/users/pychess","html_url":"https://github.com/pychess","followers_url":"https://api.github.com/users/pychess/followers","following_url":"https://api.github.com/users/pychess/following{/other_user}","gists_url":"https://api.github.com/users/pychess/gists{/gist_id}","starred_url":"https://api.github.com/users/pychess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pychess/subscriptions","organizations_url":"https://api.github.com/users/pychess/orgs","repos_url":"https://api.github.com/users/pychess/repos","events_url":"https://api.github.com/users/pychess/events{/privacy}","received_events_url":"https://api.github.com/users/pychess/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pychess/pychess/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-04T09:13:29Z","updated_at":"2015-02-04T09:13:33Z","closed_at":"2015-02-04T09:13:33Z","body":"Original [issue 829](https://code.google.com/p/pychess/issues/detail?id=829) reported by [mattgatto](https://code.google.com/u/mattgatto/) 2014-01-22\n\n**What steps will reproduce the problem?**\n1. Load an invalid FEN string. For example, a file with just \"8/q6k/q6p/pR3Np1/P3P3/6P1/1Q3P1P/6K1\" in it.\n\n**What is the expected output? What do you see instead?**\npychess should probably display a warning dialog giving an error message. Instead it crashes:\nTraceback (most recent call last):\n  File \"/home/gatto/code/hg/pychess/lib/pychess/widgets/BoardPreview.py\", line 123, in on\\_selection\\_changed\n    self.chessfile.loadToModel(sel, -1, self.gamemodel)\n  File \"/home/gatto/code/hg/pychess/lib/pychess/Savers/fen.py\", line 32, in loadToModel\n    model.boards = [model.variant.board(setup=fen)]\n  File \"/home/gatto/code/hg/pychess/lib/pychess/Utils/Board.py\", line 41, in \\_\\_init\\_\\_\n    self.board.applyFen(setup)\n  File \"/home/gatto/code/hg/pychess/lib/pychess/Utils/lutils/LBoard.py\", line 139, in applyFen\n    len(fenstr)\nSyntaxError: Needs at least 6 fields in fenstr. Pos(36)"}}