Skip to content

Commit f9afc92

Browse files
committed
Fix preference clearing
1 parent f23b555 commit f9afc92

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/assigners/a_preference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function unparse_description() {
174174
}
175175
/** @return PaperReviewPreference */
176176
private function preference_data($before) {
177-
$pref = $this->item->get($before, "_pref");
177+
$pref = $this->item->get($before, "_pref") ?? 0;
178178
$exp = $this->item->get($before, "_exp");
179179
if ($exp === "N") {
180180
$exp = null;

src/paperinfo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class PaperReviewPreference {
1313
/** @param int $preference
1414
* @param ?int $expertise */
1515
function __construct($preference = 0, $expertise = null) {
16-
$this->preference = $preference;
16+
$this->preference = $preference ?? 0;
1717
$this->expertise = $expertise;
1818
}
1919

@@ -29,7 +29,7 @@ function exists() {
2929

3030
/** @return string */
3131
function unparse() {
32-
return ($this->preference ?? "0") . unparse_expertise($this->expertise);
32+
return $this->preference . unparse_expertise($this->expertise);
3333
}
3434

3535
/** @param PaperReviewPreference $a

0 commit comments

Comments
 (0)