stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Handle Send button error when no image is selected

Open xram64 opened this issue 3 years ago • 1 comments

Add additional check for NoneType in image_from_url_text to catch error caused by clicking "Send" buttons with no image currently selected in the gallery (AttributeError: 'NoneType' object has no attribute 'startswith').

xram64 avatar Oct 15 '22 21:10 xram64

does this improve anything

AUTOMATIC1111 avatar Oct 16 '22 07:10 AUTOMATIC1111

I guess it's a marginal UX improvement? I just figure a handled exception is better than an unhandled one for something that can come up in normal usage, but it's your call.

xram64 avatar Oct 17 '22 19:10 xram64

in this case filedata is None, there's only one None no need for type comparisons.

if filedata is None:

dfaker avatar Oct 17 '22 20:10 dfaker

Ah ok, cool, I wasn't sure since the error mentioned NoneType.

I tried to make the change but I'm new with merges and it looks like I might have messed up the PR lol If the change is wanted and it's possible to fix this PR or if I should just make a new one, lmk

xram64 avatar Oct 17 '22 22:10 xram64

It's a bit of an edge case, but I think the severity of the "ERROR" appearing in 100 places warrants it.

I think this branch is fucked further than warrants a rebase for this size change, I'll close it, feel free to offer it again cleanly.

dfaker avatar Oct 17 '22 23:10 dfaker