Added protection from NULL delegate PiperOrigin-RevId: 333668953 Change-Id: Id1b8c09d4c8b830814261fa4f64c0850aa7a2f46