{"record":{"id":"27a90e6208cd2f9d","repo":"pentaho/pentaho-kettle","slug":"filename-not-provided","errorCode":null,"errorMessage":"Filename not provided","messagePattern":"Filename not provided","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/core/util/SwingSvgImageUtil.java","lineNumber":109,"sourceCode":"    if ( result == null ) {\n      result = loadFromClassLoader( classLoader, \"/\" + filename );\n      if ( result == null ) {\n        result = loadFromClassLoader( classLoader, \"ui/images/\" + filename );\n        if ( result == null ) {\n          result = getImageAsResourceInternal( filename );\n        }\n      }\n    }\n    return result;\n  }\n\n  /**\n   * Load image from several sources.\n   */\n  public static SwingUniversalImage getUniversalImage( ClassLoader classLoader, String filename ) {\n\n    if ( StringUtils.isBlank( filename ) ) {\n      throw new RuntimeException( \"Filename not provided\" );\n    }\n\n    SwingUniversalImage result = null;\n    if ( SvgSupport.isSvgEnabled() ) {\n      result = getUniversalImageInternal( classLoader, SvgSupport.toSvgName( filename ) );\n    }\n\n    // if we haven't loaded SVG attempt to use PNG\n    if ( result == null ) {\n      result = getUniversalImageInternal( classLoader, SvgSupport.toPngName( filename ) );\n    }\n\n    // if we can't load PNG, use default \"no_image\" graphic\n    if ( result == null ) {\n      result = getImageAsResource( NO_IMAGE );\n    }\n    return result;\n  }","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/core/util/SwingSvgImageUtil.java#L91-L127","documentation":"SwingSvgImageUtil.getUniversalImage throws RuntimeException when the filename argument is null, empty, or whitespace-only. It is a fail-fast guard before attempting to load the image from SVG or PNG sources. The error means the caller passed no filename at all, not that the file is missing on disk.","triggerScenarios":"Calling getUniversalImage(classLoader, null), getUniversalImage(classLoader, \"\"), or with a blank/whitespace filename.","commonSituations":"A configuration field for an image path was left empty; a variable placeholder was not substituted so the filename resolves to blank; refactoring removed the default image name.","solutions":["Pass a valid, non-blank filename (e.g. \"images/icon.svg\") to getUniversalImage.","Check where the filename variable comes from — validate it is non-empty before calling.","Provide a fallback default image name when the configured value is blank.","Use StringUtils.isBlank(filename) as a pre-call guard to fail with a clearer app-level message."],"exampleFix":"// before\nSwingUniversalImage img = SwingSvgImageUtil.getUniversalImage(cl, cfg.getImage());\n// after\nif (StringUtils.isBlank(cfg.getImage())) {\n  throw new IllegalStateException(\"Image not configured\");\n}\nSwingUniversalImage img = SwingSvgImageUtil.getUniversalImage(cl, cfg.getImage());","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(filename)) {\n  filename = DEFAULT_IMAGE;\n}\nSwingUniversalImage img = SwingSvgImageUtil.getUniversalImage(classLoader, filename);","typeGuard":"boolean valid = filename != null && !filename.trim().isEmpty();","tryCatchPattern":"try {\n  img = SwingSvgImageUtil.getUniversalImage(cl, filename);\n} catch (RuntimeException e) {\n  img = SwingSvgImageUtil.getUniversalImage(cl, DEFAULT_IMAGE);\n}","preventionTips":["Validate configured image paths at startup","Resolve variables/placeholders before passing filenames","Keep a default fallback image constant"],"tags":["blank-argument","image-loading","runtime-exception"],"backgroundTag":"missing-required-argument","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}