lob / lob-php

PHP Client for Lob API
https://lob.com
MIT License
67 stars 21 forks source link

Error when creating a letter verification #188

Open CLCWebsiteServices opened 2 months ago

CLCWebsiteServices commented 2 months ago

Summary

The file on which is addressed when creating a letter verification appears to have been wrote in a way that even if you don't provide a file for the letter (null) it'll still always attempt to read the contents of the variable via the Utils::tryFopen($file, 'r') function.

Expected Behavior

A check should be performed on the $file variable to detect whether it's null or not.

Current Behavior

GuzzleHttp\Psr7\Utils::tryFopen(): Argument #1 ($filename) must be of type string, null given, called in /vendor/lob/lob-php/lib/Api/LettersApi.php on line 349

Possible Solution

I have wrote a PR with a valid fix for this issue. #187