mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
Return error if label template preview image is nil [SCI-9070] (#6077)
This commit is contained in:
parent
5ea31337b7
commit
103b62798b
|
@ -133,7 +133,7 @@ class LabelTemplatesController < ApplicationController
|
|||
# only render last generated label image
|
||||
payload = service.generate_zpl_preview!.split.last
|
||||
|
||||
if service.error.blank?
|
||||
if service.error.blank? && payload.present?
|
||||
render json: { base64_preview: payload }
|
||||
else
|
||||
render json: { error: service.error }, status: :unprocessable_entity
|
||||
|
|
Loading…
Reference in a new issue