Merge "Add null checks to prevent NPE on ViewModel." into main