Don't cast a GtkLabel into a GisSnapTile
We populate a GtkFlowBox with tiles representing features snaps. There might not be exactly enough to fill up the entire number of rows, so the remaining cells are filled up with blank space, which is actually a GtkLabel. When clicking these tiles, we launch Software to the application that's been clicked. That is done by looking inside the tile to find its associated snap. We try to do this 'looking inside' for the blank tiles too. But they aren't snaps at all - as mentioned above, they are GtkLabels. We illegally cast to a snap tile, and then operate on it. At best, this leads to a warning on stderr and Software getting spawned to display a nonsense application. At worst we crash. Fix this by altering the callback to check if we have clicked on a snap or not. In the not case, simply return and do nothing. LP: #1901548
parent
57b947f0
Please register or sign in to comment