Issue #2317913 by jhedstrom: Early error handling can result in fatal error (Call to a member function get() on a non-object)