Merge "Fix NPE with null app window." into pi-dev