Merge "hal: add NULL check for stream in"