Hmmm... so I guess `if ( empty(modules [0]) || empty(modules[0]->stages) )` or similar?