Sorry, missed this one.

CDbUrl::IsValid() returns true, if the path passed to CDbUrl::FromString() is valid and false otherwise (same as the return value from FromString() itself.

If the URL isn't valid an early return is probably the best thing to do.

IIRC there are a few places in CMusicDatabase where this check might be missing.