Merge "Added extra check to avoid NPE if package does not exist." into nyc-dev