Added null pointer check to check_variant.
Authored by: tswift 2018-05-18
Parent: [r9290]
Child: [r9292]