When a plaintiff obtains judgment against a corporate entity and then institutes an independent action against an alter ego, the alter ego defendant may recover attorney fees under Civil Code 1717, even if the subsequent action did not include contract causes of action.