Avoid possible NULL-dereference in 3rd party apps using deprecated API