Return error if label template preview image is nil [SCI-9070] (#6077)

This commit is contained in:
ajugo 2023-08-24 16:45:34 +02:00 committed by GitHub
parent 5ea31337b7
commit 103b62798b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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