Skip to content

Commit

Permalink
fix: null pointer (kaytu-io#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahanmmi authored Jun 20, 2024
1 parent e1890fb commit e55c50b
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions view/non_interactive_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,16 @@ func (v *NonInteractiveView) WaitAndShowResults(nonInteractiveFlag string) error
select {
case ready := <-v.resultsReady:
if ready == true {
for v.Optimizations.IsProcessing() {
os.Stderr.WriteString(fmt.Sprintf("%s - Export still processing, waiting for it to finish...\n", time.Now().Format(time.RFC3339)))
time.Sleep(1 * time.Second)
if v.Optimizations != nil {
for v.Optimizations.IsProcessing() {
os.Stderr.WriteString(fmt.Sprintf("%s - Export still processing, waiting for it to finish...\n", time.Now().Format(time.RFC3339)))
time.Sleep(1 * time.Second)
}
} else {
for v.PluginCustomOptimizations.IsProcessing() {
os.Stderr.WriteString(fmt.Sprintf("%s - Export still processing, waiting for it to finish...\n", time.Now().Format(time.RFC3339)))
time.Sleep(1 * time.Second)
}
}
if nonInteractiveFlag == "table" {
if v.NonInteractiveExport != nil && v.NonInteractiveExport.Table != "" {
Expand Down Expand Up @@ -243,9 +250,16 @@ func (v *NonInteractiveView) WaitAndReturnResults(nonInteractiveFlag string) (st
select {
case ready := <-v.resultsReady:
if ready == true {
for v.Optimizations.IsProcessing() {
os.Stderr.WriteString(fmt.Sprintf("%s - Export still processing, waiting for it to finish...\n", time.Now().Format(time.RFC3339)))
time.Sleep(1 * time.Second)
if v.Optimizations != nil {
for v.Optimizations.IsProcessing() {
os.Stderr.WriteString(fmt.Sprintf("%s - Export still processing, waiting for it to finish...\n", time.Now().Format(time.RFC3339)))
time.Sleep(1 * time.Second)
}
} else {
for v.PluginCustomOptimizations.IsProcessing() {
os.Stderr.WriteString(fmt.Sprintf("%s - Export still processing, waiting for it to finish...\n", time.Now().Format(time.RFC3339)))
time.Sleep(1 * time.Second)
}
}
if nonInteractiveFlag == "table" {
var str string
Expand Down

0 comments on commit e55c50b

Please sign in to comment.