AOKP/packages_apps_ROMControl — comment on commit 82a49e0d42175947f42b4575ae9aac88d5089c49
File:  line 0
By Leandros:

I dont expect it that it throw a exception, I know it. Because its happened to me. :)

But yes, your null check is a better way. Was only a fast fix, dont think long about it.