substitute nil values when substitution is present

Test Plan:
 - It should substitute empty variables
   * $Canvas.account.sisSourceId
   * $Canvas.course.sisSourceId
   * $Canvas.user.sisSourceId

Change-Id: Iecbe0f6d2ccff2a0664bd4ec98102a1f3db173b1
Reviewed-on: https://gerrit.instructure.com/37163
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>