Resilience moderates the risk of depression and anxiety symptoms on suicidal ideation in patients with depression and/or anxiety disorders.