mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Log a warning if dataURI
property is missing from image argument specification in extension info. Default to empty string if dataURI or alt are not provided.
This commit is contained in:
parent
167f502edc
commit
6afbe192d8
1 changed files with 5 additions and 2 deletions
|
@ -1244,10 +1244,13 @@ class Runtime extends EventEmitter {
|
||||||
// check if this is not one of those cases. E.g. an inline image on a block.
|
// check if this is not one of those cases. E.g. an inline image on a block.
|
||||||
if (argTypeInfo.type && !argTypeInfo.shadowType && !argTypeInfo.fieldType) {
|
if (argTypeInfo.type && !argTypeInfo.shadowType && !argTypeInfo.fieldType) {
|
||||||
if (argTypeInfo.type === 'IMAGE') {
|
if (argTypeInfo.type === 'IMAGE') {
|
||||||
|
if (!argInfo.dataURI) {
|
||||||
|
log.warn('Missing data URI in extension block with argument type IMAGE');
|
||||||
|
}
|
||||||
argJSON = {
|
argJSON = {
|
||||||
type: 'field_image',
|
type: 'field_image',
|
||||||
alt: argInfo.alt,
|
alt: argInfo.alt || '',
|
||||||
src: argInfo.dataURI,
|
src: argInfo.dataURI || '',
|
||||||
// TODO these probably shouldn't be hardcoded...?
|
// TODO these probably shouldn't be hardcoded...?
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
|
|
Loading…
Reference in a new issue