Merge "Check for null before invoking finish()"