Merge "hal: Avoid null pointer exceptions"