Issue #2897938 by tedbow, drpal: Prevent accessing null elements when operating on ajax instances using the off_canvas renderer (cherry picked from commit b5ec4f1d)