Skip to content

Commit

Permalink
Fix preference clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 14, 2024
1 parent f23b555 commit f9afc92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/assigners/a_preference.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function unparse_description() {
}
/** @return PaperReviewPreference */
private function preference_data($before) {
$pref = $this->item->get($before, "_pref");
$pref = $this->item->get($before, "_pref") ?? 0;
$exp = $this->item->get($before, "_exp");
if ($exp === "N") {
$exp = null;
Expand Down
4 changes: 2 additions & 2 deletions src/paperinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PaperReviewPreference {
/** @param int $preference
* @param ?int $expertise */
function __construct($preference = 0, $expertise = null) {
$this->preference = $preference;
$this->preference = $preference ?? 0;
$this->expertise = $expertise;
}

Expand All @@ -29,7 +29,7 @@ function exists() {

/** @return string */
function unparse() {
return ($this->preference ?? "0") . unparse_expertise($this->expertise);
return $this->preference . unparse_expertise($this->expertise);
}

/** @param PaperReviewPreference $a
Expand Down

0 comments on commit f9afc92

Please sign in to comment.