Merge "Fix NPE for invalid target exception"