Merge "Add safe check for getSubId() to fix NPE"