Merge "AHAL: fix compilation error and avoid null pointer"