Fix the last fix of the max y-range computation
ClosedPublic

Authored by alexde on Sep 17 2019, 8:50 PM.

Details

Summary

The last fix was not correct as floor is needed. Therefore, this version should serve better.

Diff Detail

Repository
R102 KInfoCenter
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alexde created this revision.Sep 17 2019, 8:50 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 17 2019, 8:50 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
alexde requested review of this revision.Sep 17 2019, 8:50 PM
alexde edited the summary of this revision. (Show Details)Sep 17 2019, 8:52 PM
alexde edited the summary of this revision. (Show Details)

I still get:

file:///home/nate/kde/usr/share/kpackage/kcms/kcm_energyinfo/contents/ui/Graph.qml:114: TypeError: Cannot read property 'x' of undefined
file:///home/nate/kde/usr/share/kpackage/kcms/kcm_energyinfo/contents/ui/Graph.qml:114: TypeError: Cannot read property 'x' of undefined
alexde added a comment.EditedSep 17 2019, 9:20 PM

I still get:

file:///home/nate/kde/usr/share/kpackage/kcms/kcm_energyinfo/contents/ui/Graph.qml:114: TypeError: Cannot read property 'x' of undefined
file:///home/nate/kde/usr/share/kpackage/kcms/kcm_energyinfo/contents/ui/Graph.qml:114: TypeError: Cannot read property 'x' of undefined

I have seen this error myself before at another place, which was the scalePoint function if I remember it correctly -- simply where data[index].x is accessed the first time in the code path.

As I haven't touched the data, it can be assumed that's not my fault that those values are undefined for some weird reason.

I will investigate the reason behind this bug later, when I definitely have more time. :)

alexde updated this revision to Diff 66343.Sep 17 2019, 9:56 PM

Add range check for index variable

This range check should definitely be included. The other error, I don't know right away. If no one else spots it, I will check it on the weekend.

Regards

alexde updated this revision to Diff 66344.Sep 17 2019, 10:04 PM

The next loop starts with index+1. This rare case with index out of bounds should not happen, but just in case ...

ngraham accepted this revision.Sep 17 2019, 11:41 PM

You good now?

This revision is now accepted and ready to land.Sep 17 2019, 11:41 PM
This revision was automatically updated to reflect the committed changes.