Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized string offset 0 #189

Open
webconstructor opened this issue Sep 16, 2024 · 5 comments
Open

Uninitialized string offset 0 #189

webconstructor opened this issue Sep 16, 2024 · 5 comments

Comments

@webconstructor
Copy link

We get lots of warnings in our logs:
Uninitialized string offset 0 in /srv/wordpress/wp-content/plugins/m-chart/components/class-m-chart-chartjs.php on line 169.
about:
https://github.com/methnen/m-chart/blob/master/components/class-m-chart-chartjs.php#L169

Could this be programmed a little more defensively?

@methnen
Copy link
Owner

methnen commented Sep 16, 2024

Yeah, that's funny. So basically there's no chart data yet and it's throwing the warning. That's an easy enough fix.

I'll try to get that out quickly. That's an easy .x.x release.

I'm surprised that hasn't been called out by someone or noticed by myself before. I wonder if something else changed to make that occur more frequently.

@webconstructor
Copy link
Author

webconstructor commented Sep 17, 2024 via email

@methnen
Copy link
Owner

methnen commented Sep 29, 2024

Spent a little time on this and I oddly can't duplicate it at all. That said, I've added an additional check to make sure there's something there before passing it to the parse function.

I also fixed another warning I found along the way.

#193

I you could try this one out and see if it works that would be awesome and I'll then push it live to everyone. It's a small change.

@methnen methnen mentioned this issue Sep 29, 2024
@webconstructor
Copy link
Author

webconstructor commented Sep 30, 2024 via email

@methnen
Copy link
Owner

methnen commented Sep 30, 2024

Ah, so the warning is only happening on production. That's interesting.

It's a small change and it should not break anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants