Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix divide by zero number error
  • Loading branch information
Samweli authored and nyalldawson committed Apr 30, 2020
1 parent dc023e6 commit bc3cea9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/providers/wms/qgswmscapabilities.cpp
Expand Up @@ -335,6 +335,9 @@ QDateTime QgsWmsSettings::findLeastClosestDateTime( QDateTime dateTime, bool dat
break;

long long resolutionSeconds = pair.resolution.interval();

if ( resolutionSeconds <= 0 )
continue;
long long step = std::floor( ( seconds - startSeconds ) / resolutionSeconds );
long long resultSeconds = startSeconds + ( step * resolutionSeconds );

Expand Down

0 comments on commit bc3cea9

Please sign in to comment.