[PATCH 4/5] Fix a traceback when removing non-existing partitions in custom. (#869839)