Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
chore: added error blocker to unwrap without being sure that the valu…
Browse files Browse the repository at this point in the history
…e is declared
  • Loading branch information
scarletquasar committed Sep 16, 2023
1 parent 2188b19 commit ff9a709
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions projects/core/logic/api/modules/stdlib/functional-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class Result<TLeft extends Error, TRight> {
}

unwrap() {
if (this.rightValue == null || this.rightValue == undefined) {
throw new Error("The target value is not specified correctly and the operation is unsafe.");
}
return this.rightValue;
}

Expand Down

0 comments on commit ff9a709

Please sign in to comment.