Fix checking of NULL or empty OC::$THIRDPARTYROOT/OC::$THIRDPARTYWEBROOT

Fixes #10065

See issue for details.
As long as they are defined as a (static) property, this should be fine.