Fixed null pointer bug on iOS

Fixed bug with null pointer on calling preventScreenLock on iOS