Merge "Fix potential NPE during initialization"