henck / henck/rtf-html-php

Uncaught Error: Call to a member function toStyle() on null in /vendor/henck/rtf-to-html/src/Html/State.php:68 Stack trace: #0

Open
#93 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
107
Forks
79
PR merge metrics
No merged PRs in 30d

Description

Hi thanks for your code ! but I have encounter this error while using your composer package
it seems the error doesn't come from my part of the code
i am using php 8.1.11 and the RTF document has been generated using TextEdit on MacOS BigSur
the parser debugger doesn't provide any more information on this error

for now I have remove the font style support of the code and its working perfectly
Thank again

Warning: Undefined array key 0 in /vendor/henck/rtf-to-html/src/Html/State.php on line 67

Removed lines :

    if(isset($this->font)) {
      $font = self::$fonttbl[$this->font];
      $style .= $font->toStyle();
    }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in vendor/henck/rtf-to-html/src/Html/State.php around lines 67-68 and inspect how the font table is populated and accessed. Reproduce with an RTF document generated by TextEdit on macOS Big Sur, then verify that parsing no longer raises the null toStyle() error while font styling remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.