Merge "Add the condition check to avoid NULL pointer." into linaro-master