Detects the bug that was fixed in 68d501abd8ebabfa7131f74815c9917de3a56d92 (cherry picked from commit 87bf6d31)