Created attachment 651709[details][diff][review]
Patch
Testing an nsresult as a boolean isn't correct use of nsresult -- there are success codes other than NS_OK. (Although maybe there shouldn't be!) This will no longer compile when nsresult is an enum class, because enum classes can't be implicitly converted to other types.
This shouldn't change behavior as long as nothing here uses success codes other than NS_OK. I wasn't able to easily verify that was the case here, but it seems likely.