@@ -600,27 +600,57 @@ void migrateConfiguration(void) {
600
600
}
601
601
else if ((isInString (configLines[i], " Zoom" )) && (!isInString (configLines[i], " CamZoom" )) && (!isInString (configLines[i], " ZoomMode" )) && (!isInString (configLines[i], " ZoomOffsetX" )) && (!isInString (configLines[i], " ZoomOffsetY" ))) {
602
602
CamZoom_lines = i;
603
- CamZoom_value = alphanumericToBoolean (splitted[1 ]);
603
+ if (splitted.size () < 2 ) {
604
+ CamZoom_value = false ;
605
+ }
606
+ else {
607
+ ESP_LOGE (TAG, " splitted[1]: %s" , splitted[1 ].c_str ());
608
+ CamZoom_value = alphanumericToBoolean (splitted[1 ]);
609
+ }
604
610
CamZoom_found = true ;
605
611
}
606
612
else if ((isInString (configLines[i], " ZoomMode" )) && (!isInString (configLines[i], " CamZoom" ))) {
607
613
CamZoomSize_lines = i;
608
- if (isStringNumeric (splitted[1 ])) {
609
- CamZoomSize_value = std::stof (splitted[1 ]);
614
+ if (splitted.size () < 2 ) {
615
+ CamZoomSize_value = 0 ;
616
+ }
617
+ else {
618
+ if (isStringNumeric (splitted[1 ])) {
619
+ CamZoomSize_value = std::stof (splitted[1 ]);
620
+ }
621
+ else {
622
+ CamZoomSize_value = 0 ;
623
+ }
610
624
}
611
625
CamZoom_found = true ;
612
626
}
613
627
else if ((isInString (configLines[i], " ZoomOffsetX" )) && (!isInString (configLines[i], " CamZoom" )) && (!isInString (configLines[i], " ZoomOffsetY" ))) {
614
628
CamZoomOffsetX_lines = i;
615
- if (isStringNumeric (splitted[1 ])) {
616
- CamZoomOffsetX_value = std::stof (splitted[1 ]);
629
+ if (splitted.size () < 2 ) {
630
+ CamZoomOffsetX_value = 0 ;
631
+ }
632
+ else {
633
+ if (isStringNumeric (splitted[1 ])) {
634
+ CamZoomOffsetX_value = std::stof (splitted[1 ]);
635
+ }
636
+ else {
637
+ CamZoomOffsetX_value = 0 ;
638
+ }
617
639
}
618
640
CamZoom_found = true ;
619
641
}
620
642
else if ((isInString (configLines[i], " ZoomOffsetY" )) && (!isInString (configLines[i], " CamZoom" )) && (!isInString (configLines[i], " ZoomOffsetX" ))) {
621
643
CamZoomOffsetY_lines = i;
622
- if (isStringNumeric (splitted[1 ])) {
623
- CamZoomOffsetY_value = std::stof (splitted[1 ]);
644
+ if (splitted.size () < 2 ) {
645
+ CamZoomOffsetY_value = 0 ;
646
+ }
647
+ else {
648
+ if (isStringNumeric (splitted[1 ])) {
649
+ CamZoomOffsetY_value = std::stof (splitted[1 ]);
650
+ }
651
+ else {
652
+ CamZoomOffsetY_value = 0 ;
653
+ }
624
654
}
625
655
CamZoom_found = true ;
626
656
}
@@ -909,7 +939,12 @@ bool setCpuFrequency(void) {
909
939
splitted = ZerlegeZeile (line);
910
940
911
941
if (toUpper (splitted[0 ]) == " CPUFREQUENCY" ) {
912
- cpuFrequency = splitted[1 ];
942
+ if (splitted.size () < 2 ) {
943
+ cpuFrequency = 160 ;
944
+ }
945
+ else {
946
+ cpuFrequency = splitted[1 ];
947
+ }
913
948
break ;
914
949
}
915
950
}
0 commit comments