[SPARK-21826][SQL][2.1][2.0] outer broadcast hash join should not throw NPE
backport https://github.com/apache/spark/pull/19036 to branch 2.1 and 2.0
Author: Wenchen Fan <wenchen@databricks.com>
Closes #19040 from cloud-fan/bug.
(cherry picked from commit 576975356357ead203e452d0d794794349ba4578)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>