Skip to content

Commit eaa97f3

Browse files
committed
add anchor to help URL only if necessary
1 parent 23c09fc commit eaa97f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/gui/qgshelp.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ QUrl QgsHelp::helpUrl( const QString& key )
8787
continue;
8888
}
8989
helpUrl = QUrl::fromLocalFile( filePath );
90-
helpUrl.setFragment( helpPath.mid( helpPath.lastIndexOf( "#" ) + 1, -1 ) );
90+
int pos = helpPath.lastIndexOf( "#" );
91+
if ( pos != -1 )
92+
{
93+
helpUrl.setFragment( helpPath.mid( helpPath.lastIndexOf( "#" ) + 1, -1 ) );
94+
}
9195
}
9296

9397
helpFound = true;

0 commit comments

Comments
 (0)