Merge "Try to avoid possible NPE" into jb-mr1-dev