Check that there is a company before trying to get name property #13473
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This hopefully fixes some of the final issues in #12050. I've added some comments and made sure to check that the asset in question has a company before trying to pull the name property, and fixed it so that if you select to use a logo, it will try to use the company logo first, but if it can't find one and it can't find a label image from the branding settings, it should default to no logo.
In my print preview (we just moved so we don't have a working printer yet), I'm still seeing the black outline for the labels, and I'm not sure we want that if they actually print on the screen.
(The smiley is the company logo, the very tired me is a second company with an image, the snipe logo head is the overall "company label logo" - none of the other assets have companies and therefore fall back rot the generic logo)
That serial number gets pretty hard to read, but I'm not sure what - if anything - we can do about that.
I'm probably going to merge this, just because it's acting a little funny for users on master, but I'd probably want @cram42's feedback to make sure all of the changes I made today align with the intent and his testing.