a nullcheck
scripted update of code from master at 2a7ee16 a nullcheck