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