Those where assuming we always get a valid modifier data from context, which is not always true... Also fix similar issue with shortcuts as reported in T79635.
Those where assuming we always get a valid modifier data from context, which is not always true... Also fix similar issue with shortcuts as reported in T79635.