Skip to content

Commit 5935f2b

Browse files
committed
fix lint issue
1 parent e8363f5 commit 5935f2b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Bidi/Shaping/Arabic.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,12 @@ protected function processAlChar(int $idx, int $pos, ?array $prevchar, array $th
336336
$laaChar = $this->alchars[$pos - 1] ?? null;
337337
assert($laaChar !== null, 'Expected previous lam character while composing lam-alef ligature');
338338
$deleteIdx = $this->getNewCharIndexBySourceIndex($laaChar['i']);
339-
$item = $deleteIdx !== null ? $this->newchardata[$deleteIdx] ?? null : null;
339+
if ($deleteIdx === null) {
340+
assert(false, 'Expected shaped lam-alef source item before marking it for deletion');
341+
return;
342+
}
343+
344+
$item = $this->newchardata[$deleteIdx] ?? null;
340345
assert($item !== null, 'Expected shaped lam-alef source item before marking it for deletion');
341346
$item['char'] = -1;
342347
$this->newchardata[$deleteIdx] = $item;

0 commit comments

Comments
 (0)