However, if there's a pay if paid clause in the contract between a sub and their customer, that might limit the ability to pursue a mechanics lien claim to some degree. But, even if it's true that the owner hasn't paid the GC, that won't necessarily block the viability of a subcontractor's mechanics lien claim. It's common for a customer to claim that they can't make payment because the owner hasn't paid them yet.
Though, the validity of that claim could certainly be the subject of dispute later on if there's issues with the work or if there's some reason the sub isn't owed payment. And, it's important to recall that a sub can still file their lien even if there's a dispute over what they're owed and even if there's a dispute over the quality of the work. Receiving a Notice of Default and Termination from a customer will serve as notice that the contract is being terminated, but it doesn't mean that a subcontractor isn't entitled to be paid what they're currently owed for the job.