With respect to legal justification the court reviews whether the claimant was under any contractual obligation, statutory obligation or otherwise to provide work and/or services to the recipient, here Nick. Another way the courts characterize this is that there is an absence of juristic reasons for the enrichment: Peter v. Beblow, 1993 CanLII 126 (SCC),  1 S.C.R. 980 at para. 89.
"The most advanced legal research software ever built."
The above passage should not be considered legal advice. Reliable answers to complex legal questions require comprehensive research memos. To learn more visit www.alexsei.com.