Fix for ptr == NULL when assigning texture manually