[PLAT-3420] Don't wait indefinately if result is null (cherry-picking from commit 9415bfd104d7e0da4d7f23fb177ffe5f1cefe523)