Fix null pointer exception in platform input handler