Skip to content

Commit acf3134

Browse files
committed
fix build on hhvm latest
1 parent 56a64d1 commit acf3134

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

hhast-lint.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"roots": [ "src/Nuxed/Filesystem/" ],
2+
"roots": [ "src/" ],
33
"builtinLinters": "all",
44
"disableAllAutoFixes": false,
55
"disabledLinters": [

src/Nuxed/Filesystem/Lines.hack

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ final class Lines implements \Countable, \IteratorAggregate<string> {
1212
}
1313

1414
public function first(): string {
15-
try {
16-
return C\firstx($this->lines);
17-
} catch (\HH\InvariantException $e) {
15+
if (C\is_empty($this->lines)) {
1816
throw new Exception\OutOfRangeException(
1917
'Lines instance is empty.',
20-
$e->getCode(),
21-
$e,
2218
);
2319
}
20+
21+
return C\firstx($this->lines);
2422
}
2523

2624
/**

0 commit comments

Comments
 (0)