mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
fix: misleading error if image is corrupted (#222)
width/height can be nil here, first case doesn't match but nil is indeed bigger than 32767, so the incorrect error message will be displayed
This commit is contained in:
parent
2cfde149ef
commit
3714ae115c
1 changed files with 1 additions and 1 deletions
|
@ -187,7 +187,7 @@ defmodule Philomena.Images.Image do
|
||||||
height = fetch_field!(changeset, :image_height)
|
height = fetch_field!(changeset, :image_height)
|
||||||
|
|
||||||
cond do
|
cond do
|
||||||
width <= 0 or height <= 0 ->
|
is_nil(width) or is_nil(height) or width <= 0 or height <= 0 ->
|
||||||
add_error(
|
add_error(
|
||||||
changeset,
|
changeset,
|
||||||
:image,
|
:image,
|
||||||
|
|
Loading…
Reference in a new issue