BUG: fix undeclared var in StudyDescriptionHandler

The flow of this block of code was missing the declaration for this
variable in some cases, it is now declared before the branching of the
if statements and is set as None.

Fixes #540
Merge pull request #544 from ElDeveloper/issue-540

BUG: fix undeclared var in StudyDescriptionHandler