Merge "Only skip trimming task if the stacks are not null." into nyc-dev