Fix NPE when trying to remove a null upgrade.