Project

General

Profile

Bug #25077

gallery::Event::getByLabel() throws an exception on empty input tag

Added by Gianluca Petrillo about 1 month ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
10/14/2020
Due date:
% Done:

100%

Estimated time:
Spent time:
Scope:
Internal
Experiment:
-
SSI Package:
gallery
Duration:

Description

What happens: gallery::Event::getByLabel(art::InputTag{}, handle) throws a art::errors::LogicError exception.

What should happen: gallery::Event::getByLabel(art::InputTag{}, handle) returns false.

The issue here is that `gallery::Event::getByLabel()` behaves differently from `art::Event::getByLabel()`, making it harder to write generic code.
The simplest workaround is to add an early check in gallery::Event::getByLabel(), something like

  if (inputTag.empty()) {
    result = Handle<PROD>{makeProductNotFoundException(typeid(PROD), inputTag)};
    return false;
  }

History

#1 Updated by Kyle Knoepfel about 1 month ago

  • Status changed from New to Accepted

#2 Updated by Kyle Knoepfel about 1 month ago

  • % Done changed from 0 to 100
  • Assignee set to Kyle Knoepfel
  • Status changed from Accepted to Resolved

#3 Updated by Kyle Knoepfel about 1 month ago

  • Target version set to 1.14.03

#4 Updated by Kyle Knoepfel about 1 month ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF