Index: ValBot/Python/check_intrawiki_section_links.py
===================================================================
--- ValBot/Python/check_intrawiki_section_links.py	(revision 1174)
+++ ValBot/Python/check_intrawiki_section_links.py	(revision 1176)
@@ -69,4 +69,15 @@
         if not '#' in link_text:
             #pywikibot.stdout('Link doesn\'t have a section anchor in it. Skipping.')
+            continue
+
+        # If this link has an interwiki prefix, it can be ignored
+        is_interwiki = False
+        if found_iw_match == False:
+            for prefix in interwiki_prefixes:
+                if prefix + ":" in link_text:
+                    #pywikibot.stdout('Skipping link {} because it is an interwiki link.'.format(link_text))
+                    is_interwiki = True
+                    break
+        if is_interwiki:
             continue
         
@@ -130,16 +141,4 @@
                     break
         
-        # If we didn't match the prefix against any intrawiki prefixes, see if it matches
-        # against an interwiki prefix; if so, this link can be ignored
-        is_interwiki = False
-        if found_iw_match == False:
-            for prefix in interwiki_prefixes:
-                if prefix + ":" in link_text:
-                    #pywikibot.stdout('Skipping link {} because it is an interwiki link.'.format(link_text))
-                    is_interwiki = True
-                    break
-        if is_interwiki:
-            continue
-        
         # If we still haven't turned this match into a URL, something's gone wrong
         if (found_iw_match == False) or (iw_url == ""):
