Ensure we have an import error before using in import path (#5884)
Without this, we can panic
This commit is contained in:
parent
f81a4d28a5
commit
4f5b3c8522
|
@ -2,7 +2,9 @@ CHANGELOG
|
|||
=========
|
||||
|
||||
## HEAD (Unreleased)
|
||||
_(none)_
|
||||
|
||||
- Fix a problem where `pulumi import` could panic on an import error due to missing error message.
|
||||
[#5884](https://github.com/pulumi/pulumi/pull/5884)
|
||||
|
||||
## 2.15.3 (2020-12-07)
|
||||
|
||||
|
|
|
@ -456,7 +456,7 @@ func (ex *deploymentExecutor) importResources(callerCtx context.Context, opts Op
|
|||
canceled := callerCtx.Err() != nil
|
||||
|
||||
if res != nil || stepExec.Errored() {
|
||||
if res.Error() != nil {
|
||||
if res != nil && res.Error() != nil {
|
||||
ex.reportExecResult(fmt.Sprintf("failed: %s", res.Error()), preview)
|
||||
} else {
|
||||
ex.reportExecResult("failed", preview)
|
||||
|
|
Loading…
Reference in a new issue