refactoring code

this is not correct, `bundles` can be false according to its documentation:

> If this this property is false, it means the whole asset bundle feature is disabled and [[getBundle()]]
> will always return null.