fix crash when no platform is available

Change-Id: I730cd231ab6fe4626fefc1ddab67c1b9d77ecd0a