it seems you also need to check for `null` here? the `indices` and `aliases` can both be `null` no?